Difficulty importing the Vaadin SimpleCRM example app for local development - maven

I'm having some trouble importing the SimpleCRM example app (vaadin-jpa-app) found at the bottom of the Vaadin Blog post titled "A recipe for a data centric rich internet application" on January 20 ( Link: https://vaadin.com/blog/-/blogs/a-recipe-for-a-data-centric-rich-internet-application )
After git cloning the repository from https://hub.jazz.net/git/vaadin/vaadin-jpa-app as described in the README.md, I have tried to import the project as a Maven project into Eclipse Luna but unfortunately receive the following errors related to the pom.xml file:
vaadin-maven-plugin:7.3.7:resources
vaadin-maven-plugin:7.3.7:update-theme
vaadin-maven-plugin:7.3.7:update-widgetset
I have tried to deploy the application to my WebSphere Liberty Profile Server anyway but get a "Context Root Not Found" error.
I have also noticed that in my server.xml file under WebSphere Application Server Liberty Profile, I see warnings mentioning that the elements "jdbcDriver" and "dataSource" are "not enabled by the available features" after copying the relevant code outlined in the "Local development" section of the README.md ( from https://hub.jazz.net/project/vaadin/vaadin-jpa-app/overview )
Can someone more familiar with this process walk me through what I should be doing? It would be much appreciated. Thanks!
(Begin procedure)
Preparation:
1) In Eclipse, I installed the WebSphere Application Server Liberty Profile via Eclipse Marketplace ( http://marketplace.eclipse.org/content/ibm-websphere-application-server-liberty-profile-developer-tools-luna-0 )
2) Under the Enterprise Explorer in Eclipse, in WebSphere Application Server Liberty Profile | servers | defaultServer | server.xml, I have added the JDBC Driver configuration snippet as outlined in the Readme. I also modified the code according to the snippet you posted.
3) I added a derby.jar file into the appropriate directory as mentioned in the Readme
4) I installed the m2e-wtp connector (http://marketplace.eclipse.org/content/maven-java-ee-integration-eclipse-wtp-luna)
5) Using Git Shell, I git clone https://hub.jazz.net/git/vaadin/vaadin-jpa-app
Deploying the application:
6) Afterwards, in Eclipse, I import the vaadin-jpa-app directory I just cloned as an "Existing Maven Project". This creates a vaadin-jpa-app project as well as a vaadin-jpa-applicationEAR project in the Eclipse Enterprise Explorer.
7) At this point, the three "errors" I described earlier are rectified by choosing "Do Not Execute (add to pom)" as the action for each of the "errors". (Description: Places metadata which tells m2e to ignore the execution in the pom(s) that adds the Maven plugin to the build.)
8) I right-click the "vaadin-jpa-application [vaadin-jpa-app master]" project and select Run As | Maven Install.
9) I right-click the "vaadin-jpa-application [vaadin-jpa-app master]" project and select Run As | Run On Server.
10) I select the WebSphere Application Server Liberty Profile under localhost and ensure that only the vaadin-jpa-application (and not the vaadin-jpa-applicationEAR) is under the "Configured:" column. This produces a 404 error.
(Begin console output)
Launching defaultServer (WebSphere Application Server 8.5.5.4/wlp-1.0.7.cl50420141211-1039) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_25-b18 (en_US)
[AUDIT ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
[ERROR ] SRVE9990E: The class org.vaadin.presentation.Servlet has a #WebServlet annotation but does not implement the javax.servlet.http.HttpServlet interface.
[ERROR ] SRVE9991E: The class org.vaadin.presentation.CompressionFilter has a #WebFilter annotation but does not implement the javax.servlet.Filter interface.
[WARNING ] CWWJP9991W: openjpa.Enhance: Warn: An exception was thrown while attempting to perform class file transformation on "org.vaadin.backend.domain.Customer":
Exception : java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lcom/vividsolutions/jts/geom/Point;
[WARNING ] CWWJP9991W: openjpa.Enhance: Warn: An exception was thrown while attempting to perform class file transformation on "org.vaadin.backend.domain.Customer":
Exception : java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lcom/vividsolutions/jts/geom/Point;
[WARNING ] CWNEN0049W: Resource annotations on the methods of the org.vaadin.backend.CustomerService class will be ignored. The annotations could not be obtained because of the exception : <openjpa-2.2.3-SNAPSHOT-r422266:1595313 nonfatal general error> org.apache.openjpa.util.GeneralException: Lcom/vividsolutions/jts/geom/Point;
[WARNING ] CWWJP9991W: openjpa.Enhance: Warn: An exception was thrown while attempting to perform class file transformation on "org.vaadin.backend.domain.Customer":
Exception : java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lcom/vividsolutions/jts/geom/Point;
[ERROR ] CNTR4006E: The CustomerService enterprise bean in the vaadin-jpa-application.war module of the vaadin-jpa-application application failed to start. Exception: <openjpa-2.2.3-SNAPSHOT-r422266:1595313 nonfatal general error> org.apache.openjpa.util.GeneralException: Lcom/vividsolutions/jts/geom/Point;
at org.apache.openjpa.enhance.PCClassFileTransformer.transform0(PCClassFileTransformer.java:164)
at org.apache.openjpa.enhance.PCClassFileTransformer.transform(PCClassFileTransformer.java:126)
at org.apache.openjpa.persistence.PersistenceProviderImpl$ClassTransformerImpl.transform(PersistenceProviderImpl.java:290)
at com.ibm.ws.jpa.management.JPAPUnitInfo.transformClass(JPAPUnitInfo.java:1380)
at [internal classes]
Caused by: java.lang.NoClassDefFoundError: Lcom/vividsolutions/jts/geom/Point;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2575)
at java.lang.Class.getDeclaredFields(Class.java:1908)
at org.apache.openjpa.lib.util.J2DoPrivHelper$7.run(J2DoPrivHelper.java:297)
at org.apache.openjpa.lib.util.J2DoPrivHelper$7.run(J2DoPrivHelper.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.determineImplicitAccessType(PersistenceMetaDataDefaults.java:366)
at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.determineAccessType(PersistenceMetaDataDefaults.java:334)
at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.populate(PersistenceMetaDataDefaults.java:276)
at org.apache.openjpa.meta.MetaDataRepository.addMetaData(MetaDataRepository.java:920)
at org.apache.openjpa.meta.MetaDataRepository.addMetaData(MetaDataRepository.java:905)
at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.getMetaData(AnnotationPersistenceMetaDataParser.java:752)
at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parseClassAnnotations(AnnotationPersistenceMetaDataParser.java:545)
at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parse(AnnotationPersistenceMetaDataParser.java:415)
at org.apache.openjpa.persistence.PersistenceMetaDataFactory.load(PersistenceMetaDataFactory.java:260)
at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:586)
at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:396)
at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:388)
at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:286)
at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:257)
at org.apache.openjpa.enhance.PCClassFileTransformer.transform0(PCClassFileTransformer.java:146)
... 4 more
Caused by: java.lang.ClassNotFoundException: Could not find class 'com.vividsolutions.jts.geom.Point' as resource 'com/vividsolutions/jts/geom/Point.class'
... 29 more
[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/vaadin-jpa-application/
[AUDIT ] CWWKZ0001I: Application vaadin-jpa-application started in 4.171 seconds.
[AUDIT ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.
[WARNING ] CWWJP9991W: openjpa.Enhance: Warn: An exception was thrown while attempting to perform class file transformation on "org.vaadin.backend.domain.Customer":
Exception : java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lcom/vividsolutions/jts/geom/Point;
[WARNING ] CWWJP9991W: openjpa.Enhance: Warn: An exception was thrown while attempting to perform class file transformation on "org.vaadin.backend.domain.Customer":
Exception : java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lcom/vividsolutions/jts/geom/Point;
[WARNING ] CWNEN0049W: Resource annotations on the methods of the org.vaadin.backend.CustomerService class will be ignored. The annotations could not be obtained because of the exception : <openjpa-2.2.3-SNAPSHOT-r422266:1595313 nonfatal general error> org.apache.openjpa.util.GeneralException: Lcom/vividsolutions/jts/geom/Point;
[WARNING ] CWWJP9991W: openjpa.Enhance: Warn: An exception was thrown while attempting to perform class file transformation on "org.vaadin.backend.domain.Customer":
Exception : java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: Lcom/vividsolutions/jts/geom/Point;

When you start, make sure you have an eclipse installation that has no extra plugins and latest versions of liberty profile plugin (or its beta release) installed. Other eclipse plugins may disturb the deployment.
Also make sure that you have the latest version of the example project (git pull). Both Liberty and Vaadin CDI have developed fast during the last couple of months and there might have been some small incompatibilities.
The "errors" eclipse says are just that eclipse don't know how it should handle those build settings internally. You can just mark them so that eclipse ignores them and do full build once (mvn install) to get client side resources compiled.
If Eclipse creates an "ear project" when it imports the war file, just delete that and deploy the war file only.
In server.xml you must enable required features. The app needs servlet, JPA, EBJ lite and CDI, but it is probably easier and almost as lightweight to just enable whole java ee 6 web profile stuff, this is what I use in my liberty server pretty much always:
<!-- Enable features -->
<featureManager>
<feature>localConnector-1.0</feature>
<feature>webProfile-6.0</feature>
</featureManager>
If you have derby jar added as in instructions and the data source define, things should then work just fine. Let me know if there is still some issue.

Related

Websphere 8.5.5 - spring boot error: SpringServletContainerInitializer not a subtype

I have a spring boot application that works fine on Tomcat 8. When I try to deploy it on Websphere 8.5.5 with "Class loader order" set to "Classes loaded with local class loader first (parent last)" the application fails to start with the following exception:
... 73 more
Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:242)
at java.util.ServiceLoader.access$300(ServiceLoader.java:192)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:380)
at java.util.ServiceLoader$1.next(ServiceLoader.java:456)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:537)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
... 74 more
Just adding my experience with this problem, looking around on the various answers to similar problems I found out that the problem could be caused by some javax-servlet related jar in the classpath. After some trial and error I noticed that the spring-boot-starter-web dependency has an inherited spring-boot-starter-tomcat dependency. Excludung this jar from the application classpath when deploying on Websphere 8.5.5 solved the problem.

Issue in Jboss 7.2.2 migration

I am deploying a WAR file to JBoss EAP 7.2.2. During deployment, I am getting
"Caused by: java.lang.IllegalArgumentException: Unable to load generated mapper class com.amadeus.jcp.services.ttr.display.structured.builder.response.selma.mapper.offer.DisplayTripCartResponseOfferQuotationMapperSelmaGeneratedClass"
which is caused by "Caused by: java.lang.ClassNotFoundException: com.amadeus.jcp.services.ttr.display.structured.builder.response.selma.mapper.offer.DisplayTripCartResponseOfferQuotationMapperSelmaGeneratedClass"
It is a selma generated class and available in a jar inside WEB-INF/lib.
Same WAR file is deploying successfully in JBoss EAP 7.1.
As per class loader hierarchy, it should be identified but not happening.
Anybody have any idea of this issue, please help.
Verified standalone.xml and jboss-deployment-structure.xml. Using same version before and after migration except for name space version upgrade to subsystems.
Using Java 1.8.0_191

Jersey 2.10 in IBM WebSphere

I am setting up project with Jersey 2.10, JavaSE 1.7 in Websphere 8.5.5.2 (websphere 7.1 SDK)
When i deploy the project, i get this error
com.ibm.ws.webcontainer.webapp.WebApp commonInitializationFinally SRVE0266E: Error occured while initializing servlets: {0}
javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:404)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
I tried to delete the jersey libraries after deploying the project and map it to shared library (same jersey libraries) on websphere. The shared library is mapped to project now, but get other error when i run the application like below.
com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[RESTSrv01]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: Internal Server Error
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:626)
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:656)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:1301)
at org.glassfish.jersey.servlet.internal.ResponseWriter.commit(ResponseWriter.java:199)
at org.glassfish.jersey.server.ContainerResponse.close(ContainerResponse.java:412)
Any suggestion what could be the problem?

Class loading issue involving CXF on Websphere, parent last not helping

My problem concerns CXF and the wsdl4j_1.6.2.jar colliding with something, presumably the axis-wsdl4j.jar.
I have read: What's wrong with my Apache CXF client?
My project does not include the axis-wsdl4j.jar in the war. I have also asked our admin to switch Websphere to Parent Last. I still get this:
[12/13/12 16:01:28:378 CST] 0000001b ServletWrappe E SRVE0068E:
Uncaught exception thrown in one of the service methods of the
servlet: CXFServlet. Exceptio n thrown : java.lang.RuntimeException:
org.apache.cxf.interceptor.Fault:
javax/wsdl/xml/WSDLReader.readWSDL(Ljavax/wsdl/xml/WSDLLocator;Lorg/w3c/dom/Element;)
Ljavax/wsdl/Definition;
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:322)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:110)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1143)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:591)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3453)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:119)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473) Caused by: org.apache.cxf.interceptor.Fault:
javax/wsdl/xml/WSDLReader.readWSDL(Ljavax/wsdl/xml/WSDLLocator;Lorg/w3c/dom/Element;)Ljavax/wsdl/Definition;
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
... 26 more Caused by: java.lang.NoSuchMethodError: javax/wsdl/xml/WSDLReader.readWSDL(Ljavax/wsdl/xml/WSDLLocator;Lorg/w3c/dom/Element;)Ljavax/wsdl/Definition;
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:242)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:92)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
at org.apache.cxf.jaxws.ServiceImpl.(ServiceImpl.java:147)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:97)
at javax.xml.ws.Service.(Service.java:35)
...
Project is built by Maven, deployed to Websphere via Continuum only; and all settings are changed via request. Application runs perfect on local Tomcat.
EDIT:
This was eventually fixed by:
Copy wsdl4j.jar to /usr/WebSphere/AppServer/appLibs/APPNAME directory.
Chmod 775 on previous.
In websphere admin console, environment (on left), Shared Libraries, and define a container wide shared library with name as APPNAME above.
Add the jar to the classpath of the shared library.
Servers (on left), APPNAME java, process management, Class Loader and make sure "Classes loaded with application class loader first"
Click on the class loader and assign the shared library to it.
Restart Server
i think you need to disable Jax ws engine
Try setting JVM property as below
com.ibm.websphere.webservices.DisableIBMJAXWSEngine=true
here is what i would do.
Turn on verbose class loading on WAS runtime and look at the JAR that contains WSDLReader.
Check if this is the JAR that you expected to be used in run-time (to start with) based on the verbose class loading.
HTH

Moving ehcache server from one machine to another

We have been using ehcache.server.1.0.0.war for almost a year.
This week we moved to new computer. We copied cache and changed ehcache.xml accordingly.
However, the new server is now not starting. It throws the error:
SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
at org.slf4j.impl.JDK14LoggerAdapter.warn(JDK14LoggerAdapter.java:429)
at net.sf.ehcache.store.DiskStore.deleteIndexIfCorrupt(DiskStore.java:267)
at net.sf.ehcache.store.DiskStore.initialiseFiles(DiskStore.java:210)
at net.sf.ehcache.store.DiskStore.<init>(DiskStore.java:166)
at net.sf.ehcache.store.DiskStore.create(DiskStore.java:187)
at net.sf.ehcache.Cache.createDiskStore(Cache.java:1069)
at net.sf.ehcache.Cache.initialise(Cache.java:941)
at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:921)
at net.sf.ehcache.CacheManager.addConfiguredCaches(CacheManager.java:607)
at net.sf.ehcache.CacheManager.init(CacheManager.java:336)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:276)
at net.sf.ehcache.CacheManager.create(CacheManager.java:636)
at net.sf.ehcache.CacheManager.getInstance(CacheManager.java:657)
at net.sf.ehcache.server.soap.EhcacheWebServiceEndpoint.<init>(EhcacheWebServiceEndpoint.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
Any ideas appreciated.
java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
This error happens when you have wrong slf4j version of the jar. Check carefully all jar versions/sizes on your old server and make sure they are the same on a new server.
Also diff. versions of the jars could be in your new app server system classpath that would interfere with your application classpath. You should configure class loading order policy in your deployment descriptor (its specific to the app server vendor you are using)

Resources