hey, I am having somewhat related issue only. Recently the external SOAP interface which were generating client for changed to https one. and I had an old code base at hand which was generating the java files through cxf and unsecured, http:// based wsdl. I chnaged the uri and on maven side everything works fine even the test pass. but when i use this jar in the main project of mine I get this:
Caused by: java.lang.NoSuchMethodError: javax.net.ssl.HttpsURLConnection.getSSLSocketFactory()Ljavax/net/ssl/SSLSocketFactory;
at sun.net.www.protocol.https.DelegateHttpsURLConnection.getSSLSocketFactory(DelegateHttpsURLConnection.java:50)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at java.net.URL.openStream(URL.java:1010)
at org.apache.cxf.resource.URIResolver.tryFileSystem(URIResolver.java:169)
at org.apache.cxf.resource.URIResolver.resolve(URIResolver.java:119)
at org.apache.cxf.resource.ExtendedURIResolver.resolve(ExtendedURIResolver.java:41)
at org.apache.cxf.transport.TransportURIResolver.resolve(TransportURIResolver.java:134)
at org.apache.cxf.catalog.CatalogWSDLLocator.getBaseInputSource(CatalogWSDLLocator.java:72)
at org.apache.cxf.wsdl11.AbstractWrapperWSDLLocator.getBaseInputSource(AbstractWrapperWSDLLocator.java:57)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:214)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:91)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:207)
at org.apache.cxf.jaxws.ServiceImpl.(ServiceImpl.java:150)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:63)
at javax.xml.ws.Service.(Service.java:56)
at generated.webservices.com.gbm.sso.ssoclient.AuthenticationServiceInternal.(AuthenticationServiceInternal.java:49)
at com.gbm.caprice.sso.client.CachingSSOClient.init(CachingSSOClient.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
... 45 more
Can you please help?
Since you're getting a NoSuchMethodError (which is caught/thrown by the compiler), My suggestion is that you are using a version of Java class (in this case, javax.net.ssl.HttpsURLConnection) which doesn't have the following method signature:
javax.net.ssl.HttpsURLConnection.getSSLSocketFactory()
This class can be found in the JRE/lib jsse.jar (as from time of writing, JDK 1.6.0_21). Make sure that your java libraries and your Apache CXF libaries are declared in the java CLASSPATH.
That's what I can help you based on your caused exception.
Related
I used axis2 1.7.3 version for my web service requirement. when i deploy the aar files, it shows the below exception. I used the java 8 features (eg. streams, filter etc ) in web service implementation files. Does axis2 support to deploy the web services implemented with java 8 features.
org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Error looking for paramter names in bytecode: unexpected bytes in file
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:441)
at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:109)
at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:232)
at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:154)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:585)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:164)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:371)
at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:73)
at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:94)
at org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Scheduler.java:93)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Caused by: org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Error looking for paramter names in bytecode: unexpected bytes in file
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:404)
... 14 more
Caused by: java.lang.IllegalStateException: Error looking for paramter names in bytecode: unexpected bytes in file
at org.apache.axis2.description.java2wsdl.bytecode.ClassReader.readCpool(ClassReader.java:354)
at org.apache.axis2.description.java2wsdl.bytecode.ParamReader.(ParamReader.java:78)
at org.apache.axis2.description.java2wsdl.bytecode.ParamReader.(ParamReader.java:57)
at org.apache.axis2.description.java2wsdl.bytecode.ChainedParamReader.(ChainedParamReader.java:52)
at org.apache.axis2.description.java2wsdl.bytecode.MethodTable.(MethodTable.java:31)
at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.(DefaultSchemaGenerator.java:177)
at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:454)
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:396)
... 14 more
No, Axis2 (I use 1.7.4) does not work when using Java 8 features in the implementation class, because axis somehow has a problem analyzing that bytecode.
As a workaround, removing Java 8 features (e.g. streams) in the skeleton implementation solved it in my case. You can use those features anywhere except in the web service implementation class (when using Axis2).
Had a quick look at the Axis source code (https://svn.apache.org/repos/asf/axis/axis2/java/core/tags/v1.0/modules/java2wsdl/src/org/apache/ws/java2wsdl/bytecode/ClassReader.java), looks like you've got some problem with your class file ('corrupted class file', line 354).
I am running a Java test program to establish a connection to OrientDB and keep getting these exceptions when I run the code from within IntelliJ IDEA or OpenFire (xmpp server):
java.lang.NoSuchMethodError:
com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder.maximumWeightedCapacity(J)Lcom/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap$Builder;
at
com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManagerAbstract.(OSBTreeCollectionManagerAbstract.java:43)
at
com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManagerAbstract.(OSBTreeCollectionManagerAbstract.java:48)
at
com.orientechnologies.orient.client.remote.OSBTreeCollectionManagerRemote.(OSBTreeCollectionManagerRemote.java:58)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at
java.lang.Class.newInstance(Class.java:379) at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx$2.call(ODatabaseDocumentTx.java:2863)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx$2.call(ODatabaseDocumentTx.java:2854)
at
com.orientechnologies.common.concur.resource.OSharedContainerImpl.getResource(OSharedContainerImpl.java:64)
at
com.orientechnologies.orient.core.storage.OStorageAbstract.getResource(OStorageAbstract.java:143)
at
com.orientechnologies.orient.client.remote.OStorageRemoteThread.getResource(OStorageRemoteThread.java:658)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.initAtFirstOpen(ODatabaseDocumentTx.java:2853)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:260)
at
com.orientechnologies.orient.jdbc.OrientJdbcConnection.(OrientJdbcConnection.java:63)
at
com.orientechnologies.orient.jdbc.OrientJdbcDriver.connect(OrientJdbcDriver.java:52)
at java.sql.DriverManager.getConnection(DriverManager.java:571) at
java.sql.DriverManager.getConnection(DriverManager.java:187) at
com.momentum.orientdb.core.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:87)
at
com.momentum.orientdb.core.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:56)
at
com.momentum.orientdb.core.JdbcConnectionManager$getConnection.call(Unknown
Source) at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at
com.momentum.orientdb.core.test.JdbcConnectionManagerTest.testGetConnection(JdbcConnectionManagerTest.groovy:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Any idea why? How can I fix it?
UPDATE 1
It seems to me that it has to do with this library (from Google): concurrentlinkedhashmap-lru-1.4.1.jar.
But I searched the development computer's file system and found only the above mentioned version (1.4.1).
UPDATE 2 - Solution
After searching thoroughly I found that I had different version of concurrentlinkedhashmap-lru-xxxx.jar on my development machine's file system and somehow I "managed" to put two different versions in the build.
Meanwhile, I still get the same exceptions when using my library (which I've already tested) in order to establish a connection to OrientDb from within OpenFire since OpenFire uses another version of concurrentlinkedhashmap then the one being used by OrientDb (concurrentlinkedhashmap-lru-1.4.1.jar).
NoSuchMethodError happens because at runtime, Java tried to call a method on an object, and found it didn't exist, in particular:
com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder.maximumWeightedCapacity(J)Lcom/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap$Builder;
Of course, you'd expect the code wouldn't compile if that was the case, so this almost always means you've built against a different version of the class than the one provided at runtime - it's usually a versioning issue.
So, you should figure out which library you're getting ConcurrentLinkedHashMap from, and compare this with the version being used at runtime (how are you deploying this? Is it running straight from IntelliJ?). You're likely to find that they have different versions, and you'll need to alter your version to match.
Please go to the below link and download the JAR file,
http://mvnrepository.com/artifact/com.googlecode.concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.4.2
The problem is with the version which you are trying, the correct version is 1.4.2.
I use JBoss 5.0.1.
I try to deploy some EJB 3.0 beans.
This is my log during JBoss start:
23:19:15,955 ERROR [AbstractKernelController] Error installing to Create: name=jboss.j2ee:jndiName=MyServiceFacadeBean/remote,service=EJB state=Configured mode=Manual requiredState=Create
java.lang.NoSuchMethodException: org.jboss.ejb.StatelessSessionContainer.initHome()
at java.lang.Class.getMethod(Class.java:1605)
at org.jboss.ejb.StatelessSessionContainer.setupHomeMapping(StatelessSessionContainer.java:132)
at org.jboss.ejb.SessionContainer.createService(SessionContainer.java:168)
at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:344)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:320)
at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189)
at $Proxy36.create(Unknown Source)
It seems Jboss has incorrect version of required Class or I use some old/new code for EJB deploy.
Please do not tell to use different JBoss version or change my ejb-jar.xml I just want to understand where can this class be found?
The problem is that you are not using one version of JBoss. If you were this would not happen. The problem is you are using two different and incompatible JBoss libraries and when one calls the other you get this error.
Just make sure you have one version of JBoss.
I've been trying to figure this problem out for the last 2 days already, but to no avail!
My webservice, as well as the client, are working fine on my machine (I'm testing the applicaiton on Weblogic 10.3.2, same as our DEV environment). But whenever I deploy the app to DEV, the below exception shows up.
My assumption is that the classloaders are loading "old" jar files, which don't support my current application code, but I have no way of figuring out how to solve this issue.
I've tried many things, from using the 'prefer-application-packages' in my ear file, to creating the "endorsed" directory and including that in my classpath, but nothing works. (I've included both the axis2 and jaxb jars in the 'endorsed' dir).
Does anybody out there have any possible solution to this? Which jar files should I "overwrite"? Where do you think this is failing?
Any help is appreciated!!!
DEV configuration:
Weblogic 10.3.2
java.version = 1.6.0_14
java.vm.info = compiled mode
java.vm.name = BEA JRockit(R)
java.home = /app/platform/jrockit/3.1.2/jre
java.class.path = /app/platform/jrockit/3.1.2/lib/endorsed/jaxb-impl-2.2.2.jar::/app/platform/wls/10.3.2/patch_wls1032/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/app/platform/jrockit/3.1.2/lib/tools.jar:/app/platform/wls/10.3.2/utils/config/10.3/config-launch.jar:/app/platform/wls/10.3.2/wlserver_10.3/server/lib/weblogic_sp.jar:/app/platform/wls/10.3.2/wlserver_10.3/server/lib/weblogic.jar:/app/platform/wls/10.3.2/modules/features/weblogic.server.modules_10.3.2.0.jar:/app/platform/wls/10.3.2/wlserver_10.3/server/lib/webservices.jar:/app/platform/wls/10.3.2/modules/org.apache.ant_1.7.0/lib/ant-all.jar:/app/platform/wls/10.3.2/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:/app/platform/wls/10.3.2/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:/app/platform/wls/10.3.2/wlserver_10.3/server/lib/xqrl.jar
Caused By: javax.xml.bind.JAXBException: class com.comcast.cet.web.service.routing.lb.f5.impl.GetWipInfoForSpecificPoolMemberRequest nor any of its super class is known to this context.
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:605)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:486)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:320)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:249)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
at org.apache.axis2.datasource.jaxb.JAXBDSContext$1.run(JAXBDSContext.java:388)
at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:76)
at org.apache.axis2.datasource.jaxb.JAXBDSContext.marshalByElement(JAXBDSContext.java:369)
at org.apache.axis2.datasource.jaxb.JAXBDSContext.marshal(JAXBDSContext.java:339)
at org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._outputFromBO(JAXBBlockImpl.java:189)
at org.apache.axis2.jaxws.message.impl.BlockImpl.outputTo(BlockImpl.java:370)
at org.apache.axis2.jaxws.message.impl.BlockImpl.serialize(BlockImpl.java:294)
at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:965)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:79)
at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:557)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:554)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:118)
at org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:82)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:317)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:159)
at $Proxy84.getWipInfoForSpecificPoolMember(Unknown Source)
at com.comcast.cet.web.service.routing.lb.LoadBalancerMain.getWipInfoForPoolMember(LoadBalancerMain.java:73)
at com.comcast.cet.web.controllers.rpc.RoutingServiceImpl.getWipInfoForSpecificFarm(RoutingServiceImpl.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:544)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:504)
at com.comcast.cet.web.controllers.rpc.RoutingServiceRpcController.processCall(RoutingServiceRpcController.java:64)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at com.comcast.cet.web.controllers.rpc.RoutingServiceRpcController.handleRequest(RoutingServiceRpcController.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Ok, the quick solution is simply to switch from Axis2 to Apache CXF if you're running your code on weblogic or websphere (I was using the former). The reason for that is that these application servers bundle axis into their RTE, so when you managed server starts up, the axis libraries that are bundled with weblogic are read in first, rather then your axis libraries. There are a lot of "hacks" you can use/do to make this work:
Migrating from a 'war' package to an 'ear' package and utilizing the 'prefer-application-packages' feature
Creating the 'endorsed' directory and uploading your jar files there
Other options are available, but too complex to clearly spell them out
In all of the above cases, the code still didn't function properly, so the only option that I saw fit was to switch from axis2 to cxf, which isn't bundled by weblogic, therefore no "interference"! If you are using weblogic, then you'll have to add the following to the server 'startup' options:
-Djavax.xml.soap.MessageFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl
This is a known issue in weblogic.
Here are the cxf maven dependencies I had to include (I removed ALL of the axis and axiom dependencies)
org.apache.cxf
cxf-rt-frontend-jaxws
${cxf.version}
org.apache.cxf
cxf-rt-transports-http
${cxf.version}
org.apache.cxf
cxf-rt-transports-http-jetty
${cxf.version}
I am trying to get my development environment up and running, and I am having trouble with Tomcat trying to load JSF classes for some reason. My application does not use JSF; in fact, I haven't even deployed my application to tomcat yet. I am getting a number of stack traces in the startup logs and I cannot load the default tomcat homepage when I try to open http://localhost:8080 (I just get the tomcat 404 page).
Here is what the first stack trace is:
SEVERE: Error configuring application listener of class com.sun.faces.util.ReflectionUtils$ReflectionUtilsListener
java.lang.ClassNotFoundException: com.sun.faces.util.ReflectionUtils$ReflectionUtilsListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3712)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
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.deployDescriptor(HostConfig.java:626)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
I also get similar stack traces for the following other classes:
com.sun.faces.config.ConfigureListener
com.sun.faces.application.WebappLifecycleListener
I'm not sure if this is relevant, but I am running Tomcat 5.5.27 with the 1.4 compatibility pack installed, with Java 1.4.2, on Mas OS 10.5.
Thanks for any ideas!
EDIT: It seems that each of the default applications that come with Tomcat (host-manager, balancer, tomcat-docs, jsp-examples, etc) was relying on these JSF classes. I removed these default applications, and everything seems to be working.
So, my question is now:
Why does tomcat come with applications that don't include their dependencies, and what do I need to do to make those default applicaitons work?
Is your tomcat installation totally clean, or is it one you have inherited?
Check if the webapps contains existing wars/directories which may be referencing JSF classes?
UPDATE: Ah -- I see you found this was the case :-)
Not sure why tomcat doesn't include all its dependencies. Perhaps you downloaded a developer release instead of a stable one?
You might have to clean the Tomcat work directory.