maven管理ejb项目,需要引入json包,将其发布到wildfly上,运行无法找到json包的问题

qq_22496335 2016-09-21 12:07:17
我写了一个ejb项目,是用maven进行管理的,这个ejb里面需要使用到将list转换为json的方法,我通过maven依赖,导入了json依赖包,在项目里面直接写了一个带有main方法的测试类,这个测试类可以将list转换为json;我将ejb发布到wildfly里面,远程调用ejb时,可以调用到ejb中的其他方法,但是调用ejb里面把list转换为json的方法时报错,大概意思是没有找到json的依赖包,请问我应该怎样解决!谢谢各位大神!

Caused by: java.lang.NoClassDefFoundError: net/sf/json/JSONArray
at com.pekintech.secop.ejb.server.core.menu.intel.MenuIntel.queryAllMenu(MenuIntel.java:61)
at com.pekintech.secop.ejb.server.core.menu.impl.MenuImpl.get_all_menu_list(MenuImpl.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
... 44 more
...全文
126 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
Title: Advanced Java EE Development with WildFly Author: Deepak Vohra Length: 416 pages Edition: 1 Language: English Publisher: Packt Publishing Publication Date: 2015-03-27 ISBN-10: 1783288906 ISBN-13: 9781783288908 Your one-stop guide to developing Java® EE applications with the Eclipse IDE, Maven, and WildFly® 8.1 About This Book Develop Java EE 7 applications using the WildFly platform Discover how to use EJB 3.x, JSF 2.x, Ajax, JAX-RS, JAX-WS, and Spring with WildFly 8.1 A practical guide filled with easy-to-understand programming examples to help you gain hands-on experience with Java EE development using WildFly Who This Book Is For This book is for professional WildFly developers. If you are already using JBoss or WildFly but don't use the Eclipse IDE and Maven for development, this book will show you how the Eclipse IDE and Maven facilitate the development of Java EE applications with WildFly 8.1. This book does not provide a beginner-level introduction to Java EE as it is written as an intermediate/advanced course in Java EE development with WildFly 8.1. In Detail This book starts with an introduction to EJB 3 and how to set up the environment, including the configuration of a MySQL database for use with WildFly. We will then develop object-relational mapping with Hibernate 4, build and package the application with Maven, and then deploy it in WildFly 8.1, followed by a demonstration of the use of Facelets in a web application. Moving on from that, we will create an Ajax application in the Eclipse IDE, compile and package it using Maven, and run the web application on WildFly 8.1 with a MySQL database. In the final leg of this book, we will discuss support for generating and parsing JSON with WildFly 8.1. Table of Contents Chapter 1. Getting Started with EJB 3.x Chapter 2. Developing Object/Relational Mapping with Hibernate 4 Chapter 3. Developing JSF 2.x Facelets Chapter 4. Using Ajax Chapter 5. Using GWT Chapter 6. Developing a JAX-WS 2.2 Web Service Chapter 7. Developing a JAX-RS 1.1 Web Service Chapter 8. Using Spring MVC 4.1 Chapter 9. Using JAX-RS 2.0 in Java EE 7 with RESTEasy Chapter 10. Processing JSON with Java EE 7
Title: Advanced Java EE Development with WildFly Author: Deepak Vohra Length: 416 pages Edition: 1 Language: English Publisher: Packt Publishing Publication Date: 2015-03-27 ISBN-10: 1783288906 ISBN-13: 9781783288908 Your one-stop guide to developing Java® EE applications with the Eclipse IDE, Maven, and WildFly® 8.1 About This Book Develop Java EE 7 applications using the WildFly platform Discover how to use EJB 3.x, JSF 2.x, Ajax, JAX-RS, JAX-WS, and Spring with WildFly 8.1 A practical guide filled with easy-to-understand programming examples to help you gain hands-on experience with Java EE development using WildFly Who This Book Is For This book is for professional WildFly developers. If you are already using JBoss or WildFly but don't use the Eclipse IDE and Maven for development, this book will show you how the Eclipse IDE and Maven facilitate the development of Java EE applications with WildFly 8.1. This book does not provide a beginner-level introduction to Java EE as it is written as an intermediate/advanced course in Java EE development with WildFly 8.1. In Detail This book starts with an introduction to EJB 3 and how to set up the environment, including the configuration of a MySQL database for use with WildFly. We will then develop object-relational mapping with Hibernate 4, build and package the application with Maven, and then deploy it in WildFly 8.1, followed by a demonstration of the use of Facelets in a web application. Moving on from that, we will create an Ajax application in the Eclipse IDE, compile and package it using Maven, and run the web application on WildFly 8.1 with a MySQL database. In the final leg of this book, we will discuss support for generating and parsing JSON with WildFly 8.1. Table of Contents Chapter 1. Getting Started with EJB 3.x Chapter 2. Developing Object/Relational Mapping with Hibernate 4 Chapter 3. Developing JSF 2.x Facelets Chapter 4. Using Ajax Chapter 5. Using GWT Chapter 6. Developing a JAX-WS 2.2 Web Service Chapter 7. Developing a JAX-RS 1.1 Web Service Chapter 8. Using Spring MVC 4.1 Chapter 9. Using JAX-RS 2.0 in Java EE 7 with RESTEasy Chapter 10. Processing JSON with Java EE 7

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧