java.lang.ClassNotFoundException: javax.el.ELContext - java

i'm trying a simple example about Struts2 ,i encountered an below issue
----------------
Mar 02, 2014 7:16:05 PM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception
------------------------------------------------------------------------
java.lang.ClassNotFoundException: javax.el.ELContext
----------------------------------------------------
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
at java.lang.Class.privateGetPublicMethods(Class.java:2562)
at java.lang.Class.privateGetPublicMethods(Class.java:2578)
at java.lang.Class.privateGetPublicMethods(Class.java:2578)
at java.lang.Class.getMethods(Class.java:1427)
at freemarker.ext.beans.BeansWrapper.discoverAccessibleMethods(BeansWrapper.java:1395)
at freemarker.ext.beans.BeansWrapper.discoverAccessibleMethods(BeansWrapper.java:1385)
at freemarker.ext.beans.BeansWrapper.populateClassMapWithBeanInfo(BeansWrapper.java:1129)
at freemarker.ext.beans.BeansWrapper.populateClassMap(BeansWrapper.java:1072)
at freemarker.ext.beans.BeansWrapper.introspectClassInternal(BeansWrapper.java:1010)
at freemarker.ext.beans.BeansWrapper.introspectClass(BeansWrapper.java:969)
at freemarker.ext.beans.BeanModel.<init>(BeanModel.java:140)
at freemarker.ext.beans.StringModel.<init>(StringModel.java:90)
at freemarker.ext.beans.StringModel$1.create(StringModel.java:75)
at freemarker.ext.beans.BeansModelCache.create(BeansModelCache.java:45)
at freemarker.ext.util.ModelCache.getInstance(ModelCache.java:115)
at freemarker.ext.beans.BeansWrapper.wrap(BeansWrapper.java:468)
at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:867)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:106)
at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.ExistsExpression._getAsTemplateModel(ExistsExpression.java:71)
.........
It's it caused by the conflict of of the packages i import?

The Apache Tomcat web server already contains and loaded this classes from el-api.jar. To compile your application you might also include Java EE libraries including javax.servlet.jsp.jar but it's not necessary to deploy them. To choose which classes are available between classloaders see Apache Tomcat 7: Class Loader HOW-TO the documentation page.

Related

Cannot deploy application with JSF 1.2 on Weblogic 12c

I have an application that uses JSF 1.2 (Mojarra implementation) and is working fine on Weblogic 10.3.6. Now we are trying to migrate it to Weblogic 12c. We followed the recommendations specified here but it still generates a strange error on deployment:
<Sep 16, 2018 6:37:17,576 PM EEST> <Warning> <HTTP> <BEA-101162> <User defined listener com.sun.faces.config.ConfigureListener failed: java.lang.NoClassDefFoundError: javax/faces/application/ApplicationWrapper.
java.lang.NoClassDefFoundError: javax/faces/application/ApplicationWrapper
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at weblogic.utils.classloaders.GenericClassLoader.defineClassInternal(GenericClassLoader.java:1113)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:1046)
.........................................
Caused by: java.lang.ClassNotFoundException: javax.faces.application.ApplicationWrapper
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:473)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at weblogic.utils.classloaders.GenericClassLoader.defineClassInternal(GenericClassLoader.java:1113)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:1046)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1038)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:473)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.getConstructor(Class.java:1825)
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:517)
at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:405)
at javax.faces.FactoryFinder.access$400(FactoryFinder.java:135)
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:717)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:187)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:132)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:204)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:200)
Any idea? I cannot upgrade the JSF version for the moment.
All JSF 1.2 related jars are included in the EAR deployed (in APP-INF/lib). The weblogic-application.xml contains the proper configuration:
<wls:prefer-application-packages>
<wls:package-name>org.hibernate.*</wls:package-name>
<wls:package-name>antlr.*</wls:package-name>
<wls:package-name>org.springframework.*</wls:package-name>
<wls:package-name>org.apache.commons.net.*</wls:package-name>
<wls:package-name>javax.faces.*</wls:package-name>
<wls:package-name>com.sun.faces.*</wls:package-name>
<wls:package-name>com.bea.faces.*</wls:package-name>
</wls:prefer-application-packages>
<wls:prefer-application-resources>
<wls:resource-name>javax.faces.*</wls:resource-name>
<wls:resource-name>com.sun.faces.*</wls:resource-name>
<wls:resource-name>com.bea.faces.*</wls:resource-name>
<wls:resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</wls:resource-name>
</wls:prefer-application-resources>
What I concluded so far from the error is that the configurations to use JSF 1.2 worked (the class is complaining about is not in JSF 1.2) but I cannot find what who is looking for this class and why (in the code is not used anywhere, obviously since the code is 1.2 compliant)

Deploy EAR in TomEE - org/hibernate/mapping/MappedSuperclass

I am trying to deploy EAR in TomEE.
Ear contains a WAR file and a JAR file.
And inside the Jar file, under META-INF, I have the persistence.xml file.
I added hibernate jars under Tomee/lib
When I start the tomee, I am getting following exception.
org.apache.openejb.OpenEJBException: Creating application failed: C:\apache-tomee-1.7.4-webprofile-without\apps\cmsear: org/hibernate/mapping/MappedSuperclass
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:843)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:568)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:464)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:151)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:309)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:256)
at org.apache.tomee.catalina.ServerListener.install(ServerListener.java:167)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:54)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:394)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.startup.Catalina.load(Catalina.java:642)
at org.apache.catalina.startup.Catalina.load(Catalina.java:667)
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:498)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427)
Caused by: java.lang.NoClassDefFoundError: org/hibernate/mapping/MappedSuperclass
at org.hibernate.ejb.metamodel.MetamodelImpl.buildMetamodel(MetamodelImpl.java:59)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:83)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:883)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at org.apache.openejb.assembler.classic.EntityManagerFactoryCallable.call(EntityManagerFactoryCallable.java:64)
at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:116)
at org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.<init>(ReloadableEntityManagerFactory.java:102)
at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:154)
at org.apache.openejb.assembler.classic.Assembler.loadPersistenceUnits(Assembler.java:982)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:741)
... 20 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.mapping.MappedSuperclass
at org.apache.openejb.util.classloader.URLClassLoaderFirst.loadClass(URLClassLoaderFirst.java:136)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 30 more
I have tried configuring tomee and hibernate using the following link:
http://tomee.apache.org/tomee-and-hibernate.html
Could anyone help me in fixing this exception?
And please let me know if I need to provide any other information. Thanks.
Edit 1: Removed the jars from the WEB-INF/lib folder. And now getting the following exception:
INFO: Named query checking : enabled
Apr 24, 2018 11:29:31 AM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Apr 24, 2018 11:29:32 AM org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
Apr 24, 2018 11:29:32 AM org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory createDelegate
INFO: PersistenceUnit(name=JPADB, provider=org.hibernate.ejb.HibernatePersistence) - provider time 2509ms
Apr 24, 2018 11:29:32 AM org.apache.openejb.assembler.classic.Assembler destroyApplication
INFO: Undeploying app: C:\apache-tomee-1.7.4-webprofile-without\apps\cmsear
Apr 24, 2018 11:29:32 AM org.apache.openejb.assembler.classic.Assembler buildContainerSystem
SEVERE: Application could not be deployed: C:\apache-tomee-1.7.4-webprofile-without\apps\cmsear
org.apache.openejb.OpenEJBException: Creating application failed: C:\apache-tomee-1.7.4-webprofile-without\apps\cmsear: org/hibernate/mapping/MappedSuperclass
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:843)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:568)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:464)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:151)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:309)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:256)
at org.apache.tomee.catalina.ServerListener.install(ServerListener.java:167)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:54)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:394)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.startup.Catalina.load(Catalina.java:642)
at org.apache.catalina.startup.Catalina.load(Catalina.java:667)
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:498)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427)
Caused by: java.lang.NoClassDefFoundError: org/hibernate/mapping/MappedSuperclass
EDIT 2 :
Following are the jars that I have inside my tomee/lib :
hibernate-annotations-3.5.0.Final.jar
hibernate-commons-annotations-5.0.1.Final.jar
hibernate-core-3.5.0-Final.jar
hibernate-entitymanager-3.5.0-Final.jar
hibernate-jpa-2.1-api-1.0.0.Final.jar
hibernate-validator-4.2.0.Final.jar
hibernate-validator-annotation-processor-4.2.0.Final.jar
Edit 3 : Updated hibernate jars inside tomee/lib. Now the folder contains the following hibernate related jars.
hibernate-commons-annotations-5.0.1.Final.jar
hibernate-core-5.0.12-Final.jar
hibernate-entitymanager-5.0.12-Final.jar
hibernate-jpa-2.1-api-1.0.0.Final.jar
hibernate-validator-4.2.0.Final.jar
hibernate-validator-annotation-processor-4.2.0.Final.jar
jboss-logging-3.3.0.Final.jar
Edit 4 : My application.xml looks as follows:
<module>
<web>
<web-uri>abc.war</web-uri>
<context-root>abc</context-root>
</web>
</module>
<module>
<ejb>defEJB.jar</ejb>
</module>

Solr custom RequestHandler ClassNotFoundException

I was following this tutorial - http://www.slideshare.net/searchbox-com/develop-a-solr-request-handler-plugin and built the required jar file in Netbeans then put it into the lib path and added the request handler to solrconfig.xml:
<requestHandler name="/newendpoint" class="com.searchbox.DemoPlugin">
<lst name="words">
<str name="word">body</str>
<str name="word">fish</str>
<str name="word">dog</str>
</lst>
</requestHandler>
I see the jar being loaded:
INFO - 2015-02-06 12:32:21.903; org.apache.solr.core.SolrResourceLoader; Adding 'file:/data/solr/lib/DemoPlugin-1.0.jar' to classloader
But then I get an error when I try to restart solr:
ERROR - 2015-02-06 12:39:02.942; org.apache.solr.core.CoreContainer; Error creating core [test]: RequestHandler init failure
org.apache.solr.common.SolrException: RequestHandler init failure
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:873)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:646)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:491)
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:255)
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:249)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: RequestHandler init failure
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:172)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:792)
... 8 more
Caused by: org.apache.solr.common.SolrException: Error loading class 'com.searchbox.DemoPlugin'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:490)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:421)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:543)
at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:616)
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:158)
... 9 more
Caused by: java.lang.ClassNotFoundException: com.searchbox.DemoPlugin
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:474)
... 13 more
I confess I'm no java expert so am wondering if I've missed something obvious, or mechanics have changed since the tutorial was created, expanding the DemoPlugin jar it has the required com/searchbox/DemoPlugin.class file in, so I'm at a bit of a loss.
Any pointers appreciated.
Si
I have tried this tutorial and I can confirm that it works as explained.
For you I can only assume the jar is not loaded where it should (even if the log sais the classloader gets it).
I have put the jar in {solr.home}/{core.name}/lib.
A little more info on how to deploy new plugins into solar is here.
Try to use a solr.xml file and configure there exactly where the plugin should be loaded from.

Tomcat: failed to parse runtime descriptor

I tried to deploy a JAX-WS webservice under CentOS 6.3 -> Apache -> Tomcat 5.5
I read searched with google for hours, asked all of my friends and also tried to find a solution on stackoverflow but to no avail. Can somebody help me? Thank you in advance.
I receive the following error message:
Nov 26, 2012 12:36:52 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener parseAdaptersAndCreateDelegate
SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.IllegalAccessError: class com.sun.xml.ws.assembler.MetroClientTubelineAssemblyContextImpl cannot access its superclass com.sun.xml.ws.assembler.DefaultClientTubelineAssemblyContext
java.lang.IllegalAccessError: class com.sun.xml.ws.assembler.MetroClientTubelineAssemblyContextImpl cannot access its superclass com.sun.xml.ws.assembler.DefaultClientTubelineAssemblyContext
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.sun.xml.ws.assembler.MetroTubelineAssemblerFactoryImpl.doCreate(MetroTubelineAssemblerFactoryImpl.java:63)
at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory.create(TubelineAssemblerFactory.java:109)
at com.sun.xml.ws.server.WSEndpointImpl.(WSEndpointImpl.java:170)
at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:306)
at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:301)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:147)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:574)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:557)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:260)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:152)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:152)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3795)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:884)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:737)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1271)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:301)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1306)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
at java.lang.Thread.run(Thread.java:662)
Nov 26, 2012 12:36:52 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener
com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: java.lang.IllegalAccessError: class com.sun.xml.ws.assembler.MetroClientTubelineAssemblyContextImpl cannot access its superclass com.sun.xml.ws.assembler.DefaultClientTubelineAssemblyContext
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:141)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:152)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3795)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:884)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:737)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1271)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:301)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1306)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalAccessError: class com.sun.xml.ws.assembler.MetroClientTubelineAssemblyContextImpl cannot access its superclass com.sun.xml.ws.assembler.DefaultClientTubelineAssemblyContext
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.sun.xml.ws.assembler.MetroTubelineAssemblerFactoryImpl.doCreate(MetroTubelineAssemblerFactoryImpl.java:63)
at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory.create(TubelineAssemblerFactory.java:109)
at com.sun.xml.ws.server.WSEndpointImpl.(WSEndpointImpl.java:170)
at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:306)
at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:301)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:147)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:574)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:557)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:260)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:152)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
... 17 more
Nov 26, 2012 12:36:52 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Nov 26, 2012 12:36:52 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/lws] startup failed due to previous errors
Nov 26, 2012 12:36:52 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed
INFO: WSSERVLET13: JAX-WS context listener destroyed
Take a look at the documentation:
http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/IllegalAccessError.html
Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to.
Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.
In other words, MetroClientTubelineAssemblyContextImpl was compiled to be subclass of a version of super class DefaultClientTubelineAssemblyContext, but it seems that has changed in runtime.
What is probably happening to you is there are two jars in classpath with one of these two classes DefaultClientTubelineAssemblyContext or MetroClientTubelineAssemblyContextImpl. You should look for what jars have these classes and try to let only one loaded.
Seek the jars inside WEB-INF/lib of your application web archive and the jars inside $TOMCAT_HOME/lib folder to check if you find any duplicates.

Axis2 : XmlSchema class not found

I'm trying to generate Java classes with WSDL2Java. I run the simplest example and get errors.
$ jar tvf XmlSchema-1.4.7.jar | grep org/apache/ws/commons/schema/XmlSchema.class
14803 Wed Sep 22 17:28:44 CEST 2010 org/apache/ws/commons/schema/XmlSchema.class
$ ./bin/wsdl2java.sh -classpath $(echo lib/*.jar | tr ' ' ';') -uri HelloWorld.wsdl
Using AXIS2_HOME: /C/Documents and Settings/ixos/axis2-1.6.2
Using JAVA_HOME: /C/Program Files/Java/jdk1.7.0_07/
Retrieving document at 'samples/wsdl/Axis2SampleDocLit.wsdl'.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/XmlSchema
at org.apache.axis2.description.WSDLToAxisServiceBuilder.<init>(WSDLToAxisServiceBuilder.java:103)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.<init>(WSDL11ToAxisServiceBuilder.java:226)
at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.<init>(WSDL11ToAllAxisServicesBuilder.java:63)
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:166)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.XmlSchema
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 6 more
The libraries are in the path and now I'm stuck and don't know to do next. Google isn't helpful at all ...
CLASSPATH
lib/XmlSchema-1.4.7.jar;lib/activation-1.1.jar;lib/antlr-2.7.7.jar;lib/apache-mime4j-core-0.7.2.jar;lib/axiom-api-1.2.13.jar;lib/axiom-dom-1.2.13.jar;lib/axiom-
impl-1.2.13.jar;lib/axis2-adb-1.6.2.jar;lib/axis2-adb-codegen-1.6.2.jar;lib/axis2-ant-plugin-1.6.2.jar;lib/axis2-clustering-1.6.2.jar;lib/axis2-codegen-1.6.2.ja
r;lib/axis2-corba-1.6.2.jar;lib/axis2-fastinfoset-1.6.2.jar;lib/axis2-java2wsdl-1.6.2.jar;lib/axis2-jaxbri-1.6.2.jar;lib/axis2-jaxws-1.6.2.jar;lib/axis2-jibx-1.
6.2.jar;lib/axis2-json-1.6.2.jar;lib/axis2-kernel-1.6.2.jar;lib/axis2-metadata-1.6.2.jar;lib/axis2-mtompolicy-1.6.2.jar;lib/axis2-saaj-1.6.2.jar;lib/axis2-soapm
onitor-servlet-1.6.2.jar;lib/axis2-spring-1.6.2.jar;lib/axis2-transport-http-1.6.2.jar;lib/axis2-transport-local-1.6.2.jar;lib/axis2-xmlbeans-1.6.2.jar;lib/bcel
-5.1.jar;lib/commons-cli-1.2.jar;lib/commons-codec-1.3.jar;lib/commons-fileupload-1.2.jar;lib/commons-httpclient-3.1.jar;lib/commons-io-1.4.jar;lib/commons-logg
ing-1.1.1.jar;lib/geronimo-annotation_1.0_spec-1.1.jar;lib/geronimo-jaxws_2.2_spec-1.0.jar;lib/geronimo-jta_1.1_spec-1.1.jar;lib/geronimo-saaj_1.3_spec-1.0.1.ja
r;lib/geronimo-stax-api_1.0_spec-1.0.1.jar;lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar;lib/httpcore-4.0.jar;lib/jalopy-1.5rc3.jar;lib/jaxb-api-2.1.jar;lib/jaxb-
impl-2.1.7.jar;lib/jaxb-xjc-2.1.7.jar;lib/jaxen-1.1.1.jar;lib/jaxws-tools-2.1.3.jar;lib/jettison-1.0-RC2.jar;lib/jibx-bind-1.2.jar;lib/jibx-run-1.2.jar;lib/jsr3
11-api-1.0.jar;lib/juli-6.0.16.jar;lib/log4j-1.2.15.jar;lib/mail-1.4.jar;lib/mex-1.6.2-impl.jar;lib/neethi-3.0.2.jar;lib/regexp-1.2.jar;lib/tribes-6.0.16.jar;li
b/woden-api-1.0M9.jar;lib/woden-impl-commons-1.0M9.jar;lib/woden-impl-dom-1.0M9.jar;lib/wsdl4j-1.6.2.jar;lib/wstx-asl-3.2.9.jar;lib/xalan-2.7.0.jar;lib/xml-reso
lver-1.2.jar;lib/xmlbeans-2.3.0.jar
The problem is with your jdk (1.7): axis2 doesn't get along with it. Download the jdk 1.6 library and link it in your eclipse, then re-try.

Categories