`Wrote cucumber tests for my project, getting following error when running cucumber feature file. The value for field policyDays is given in my application.yml file In the service class it is defined as follows : #Value("${company.client.policyDays }")
private Integer policyDays;
Am creating an object of MyService.java (myService) in StepDefinitions.java file.
Error log : SEVERE: Exception while executing pickle java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Failed to load ApplicationContext at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at io.cucumber.core.runtime.Runtime.runFeatures(Runtime.java:117) at io.cucumber.core.runtime.Runtime.lambda$run$0(Runtime.java:82) at io.cucumber.core.runtime.Runtime.execute(Runtime.java:94) at io.cucumber.core.runtime.Runtime.run(Runtime.java:80) at io.cucumber.core.cli.Main.run(Main.java:87) at io.cucumber.core.cli.Main.main(Main.java:30)
Caused by: java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
at io.cucumber.spring.TestContextAdaptor.<init>(TestContextAdaptor.java:32)
at io.cucumber.spring.SpringFactory.start(SpringFactory.java:152)
at io.cucumber.core.runner.Runner.buildBackendWorlds(Runner.java:134)
at io.cucumber.core.runner.Runner.runPickle(Runner.java:70)
at io.cucumber.core.runtime.Runtime.lambda$executePickle$6(Runtime.java:128)
at io.cucumber.core.runtime.CucumberExecutionContext.lambda$runTestCase$5(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.RethrowingThrowableCollector.executeAndThrow(RethrowingThrowableCollector.java:23)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.Runtime.lambda$executePickle$7(Runtime.java:128)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:249)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at io.cucumber.core.runtime.Runtime.lambda$runFeatures$3(Runtime.java:110)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.SliceOps$1$1.accept(SliceOps.java:204)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at io.cucumber.core.runtime.Runtime.runFeatures(Runtime.java:111)
... 5 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myService': Unsatisfied dependency expressed through field 'policyDays'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:127)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:276)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:244)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)
... 31 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:79)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1339)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656)
... 50 more
Caused by: java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569)
at java.lang.Integer.valueOf(Integer.java:766)
at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:211)
at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:115)
Tried #Value("#{company.client.policyDays }") instead of #Value("${company.client.policyDays }"), didn't worked
I try to add an external JAR library to my JSF project.
My Project structure Looks like this:
XXX (EAR)
XXXWeb
XXXEJB
When I deploy my Project I get the following error from my Wildfly 10.1 console:
15:42:52,338 WARN [org.jboss.modules] (default task-185) Failed to define class de.sqs.topInterface.IAPIException in Module "deployment.sqs-selfservice.ear.sqs-selfserviceWeb.war:main" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link de/sqs/topInterface/IAPIException (Module "deployment.sqs-selfservice.ear.sqs-selfserviceWeb.war:main" from Service Module Loader): org/omg/CORBA/UserException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
at org.jboss.modules.Module.loadModuleClass(Module.java:606)
15:42:52,338 ERROR [org.jboss.as.ejb3.invocation] (default task-185) WFLYEJB0034: EJB Invocation failed on component SQSBean for method public java.lang.String de.ruv.sqs usc.web.beans.SQSBean.connect(): javax.ejb.EJBException: WFLYEJB0442: Unexpected Error
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:184)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:327)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)
Caused by: java.lang.NoClassDefFoundError: Failed to link de/sqs/topInterface/IAPIException (Module "deployment.sqs-selfservice.ear.sqs-selfserviceWeb.war:main" from Service Module Loader): org/omg/CORBA/UserException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
at org.jboss.modules.Module.loadModuleClass(Module.java:606)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
at de.ruv.sqsusc.web.beans.SQSBean.connect(SQSBean.java:23)
SQSBean.java:
import de.ruv.sqs.connector.SQS_Connector;
#Stateless
#Named("sqs")
public class SQSBean {
public String connect() {
SQS_Connector sc = new SQS_Connector(); // <<-- 23
}
}
At first I tried to add the libraries to EJB. After that I added it to WEB-INF/lib and to EAR/lib. But the error remains the same.
So where and how do I have to include external JAR library files with a common Software API to have access to them in my JSF Webaplication?
If you have an example or how to, it would be very, very nice!
Thank you!
I am deploying a EAR from RAD .The EAR pacakges a WAR and EJB module. I am getting the following error after the application in invoked..
javax.naming.NameNotFoundException: Context: C7M91P-L93883NNode01Cell/nodes/C7M91P-L93883NNode01/servers/server1, name: ejb/org/ifc/dots/business/services/DOTSStartupServiceHome: First component in name DOTSStartupServiceHome not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
at com.ibm.ws.naming.jndicos.CNContextImpl.mapNotFoundException(CNContextImpl.java:4360)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1793)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1748)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1499)
How do I verify the naming context entries in the websphere server... ?
Actually the error occurred because the ejb was not part of the EAR deployment descriptor..I added ejb module in the deployment descriptor and now the error is gone..
I am now getting the following error..
[2/6/14 18:16:37:808 IST] 00000023 FfdcProvider I com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_295f295f_14.02.06_18.16.37.59110970.txt com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt 1507
[2/6/14 18:16:37:810 IST] 00000023 Helpers W NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ws.naming.jndicos.CNContextImpl
Context method: lookupExt
Context name: C7M91P-L93883NNode01Cell/nodes/C7M91P-L93883NNode01/servers/server1
Target name: ejb/org/ifc/dots/business/services/DOTSStartupServiceHome
Other data: ""
Exception stack trace: com.ibm.ws.naming.util.InvalidObjectException: Some object reference in the name "ejb/org/ifc/dots/business/services/DOTSStartupServiceHome" relative to the context "C7M91P-L93883NNode01Cell/nodes/C7M91P-L93883NNode01/servers/server1" is invalid. Some possible causes include a context binding in the name which refers to a destroyed context, or an object binding which contains an invalid EJBHome reference. [Root exception is org.omg.CORBA.INV_OBJREF: Could not resolve IOR string. vmcid: 0x0 minor code: 0 completed: No]
at com.ibm.ws.naming.jndicos.CNContextImpl.mapINV_OBJREF(CNContextImpl.java:4391)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1807)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1748)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1499)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:636)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:165)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.ifc.dots.business.locator.ServiceLocator.getServiceHome(ServiceLocator.java:228)
at org.ifc.dots.business.delegation.DotsBusinessServiceDelegate.invokeService(DotsBusinessServiceDelegate.java:96)
at org.ifc.dots.web.aggregation.DOTSXMLHelper.getXML(DOTSXMLHelper.java:468)
at org.ifc.dots.web.servlet.DOTSWebServlet.getXMLElement(DOTSWebServlet.java:126)
at org.ifc.framework.web.servlet.BaseWebServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1449)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
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.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
Caused by: org.omg.CORBA.INV_OBJREF: Could not resolve IOR string. vmcid: 0x0 minor code: 0 completed: No
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolveUnresolvedBinding(WsnOptimizedNamingImpl.java:1995)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolve_binding(WsnOptimizedNamingImpl.java:1675)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:580)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2163)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:538)
at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2792)
at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2788)
at com.ibm.ws.naming.util.CommonHelpers.retry(CommonHelpers.java:762)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:2786)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1789)
... 34 more
Caused by: org.omg.CORBA.OBJECT_NOT_EXIST: SERVANT_NOT_FOUND (4) for key 0x49454a50020033e2132d077365727665723103454a420000005cacac0002000100290000005f5f686f6d654f66486f6d6573235f5f686f6d654f66486f6d6573235f5f686f6d654f66486f6d657308444f5453494923444f54534949456a622e6a617223444f54535374617274757053657276696365 vmcid: IBM minor code: C14 completed: No
at com.ibm.rmi.corba.ObjectManager.lookupServant(ObjectManager.java:110)
at com.ibm.CORBA.iiop.ServerDelegate.getServant(ServerDelegate.java:311)
at com.ibm.rmi.iiop.ORB.lookupLocalObject(ORB.java:592)
at com.ibm.CORBA.iiop.ORB.lookupLocalObject(ORB.java:1465)
at com.ibm.rmi.iiop.CDRReader.newObjRef(CDRReader.java:1290)
at com.ibm.rmi.iiop.CDRReader.read_Object(CDRReader.java:1130)
at com.ibm.rmi.iiop.CDRReader.read_Object(CDRReader.java:1094)
at com.ibm.rmi.corba.IorURL.iorbytesToObjref(IorURL.java:105)
at com.ibm.rmi.corba.IorURL.resolve(IorURL.java:93)
at com.ibm.rmi.corba.ORB.objectURLToObject(ORB.java:3718)
at com.ibm.CORBA.iiop.ORB.objectURLToObject(ORB.java:3256)
at com.ibm.rmi.corba.ORB.string_to_object(ORB.java:3619)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolveUnresolvedBinding(WsnOptimizedNamingImpl.java:1921)
... 43 more
I have an AdderService at WSO2 AS. Then I created a proxy service with transports="tcp" at WSO2 ESB:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="AdderServiceTCP" transports="tcp" statistics="disable" trace="enable" startOnLoad="true">
<target>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
<endpoint>
<address uri="http://samplehost:9765/services/AdderService/"/>
</endpoint>
</target>
<description></description>
</proxy>
I implemented AdderServiceClient class like Axis2 StockQuoteClient sample.
Using WSO2 ESB SOAP Tracer, the received request by that proxy is:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:To>tcp://localhost:55000/services/AdderServiceTCP</wsa:To>
<wsa:MessageID>urn:uuid:b3125473-064d-4a48-9cdc-558cda8e497b</wsa:MessageID>
<wsa:Action>urn:add</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<p:add xmlns:p="http://ws.apache.org/axis2">
<p:value1>70</p:value1>
<p:value2>150</p:value2>
</p:add>
</soapenv:Body>
</soapenv:Envelope>
The response sent to the client is:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:MessageID>urn:uuid:ed1424f9-c181-4d9c-b203-f37e88d0b0b7</wsa:MessageID>
<wsa:Action>urn:mediateResponse</wsa:Action>
<wsa:RelatesTo>urn:uuid:b3125473-064d-4a48-9cdc-558cda8e497b</wsa:RelatesTo>
</soapenv:Header>
<soapenv:Body>
<ns:addResponse xmlns:ns="http://ws.apache.org/axis2">
<ns:return>220</ns:return>
</ns:addResponse>
</soapenv:Body>
</soapenv:Envelope>
Thus, the AS AdderService and the proxy are running OK!
However, always happen this exception at WSO2 ESB:
23:01:53,254 [-] [tcp-Worker-4] INFO Proxy Service AdderServiceTCP received a new message...
23:01:53,322 [-] [tcp-Worker-4] INFO Message To: tcp://localhost:55000/services/AdderServiceTCP
23:01:53,322 [-] [tcp-Worker-4] INFO SOAPAction: urn:add
23:01:53,323 [-] [tcp-Worker-4] INFO WSA-Action: urn:add
23:01:53,323 [-] [tcp-Worker-4] INFO Forwarding the message to the anonymous endpoint of the proxy service
23:01:53,324 [-] [tcp-Worker-4] INFO Sending message through endpoint : endpoint_1ebcda7f255c63c453527cfec85e46233762eaf68afd77ef resolving to address = http://localhost:9765/services/AdderService/
23:01:53,325 [-] [tcp-Worker-4] INFO SOAPAction: urn:add
23:01:53,325 [-] [tcp-Worker-4] INFO WSA-Action: urn:add
23:01:53,371 [-] [PassThroughMessageProcessor-4] WARN ERROR_CODE : 0
23:01:53,373 [-] [PassThroughMessageProcessor-4] WARN ERROR_MESSAGE : Unexpected error sending message back
23:01:53,373 [-] [PassThroughMessageProcessor-4] WARN ERROR_DETAIL : org.apache.synapse.SynapseException: Unexpected error sending message back
at org.apache.synapse.core.axis2.Axis2Sender.handleException(Axis2Sender.java:170)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:164) at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:236)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:443)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:217)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722) Caused by: org.apache.axis2.AxisFault: Error while sending a TCP response
at org.apache.axis2.transport.base.AbstractTransportSender.handleException(AbstractTransportSender.java:226)
at org.apache.axis2.transport.tcp.TCPTransportSender.sendMessage(TCPTransportSender.java:65) at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:119) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:161)
... 9 more Caused by: java.net.SocketException: Socket is closed at java.net.Socket.getOutputStream(Socket.java:904) at org.apache.axis2.transport.tcp.TCPTransportSender.sendMessage(TCPTransportSender.java:63) ... 12 more
23:01:53,378 [-] [PassThroughMessageProcessor-4] WARN ERROR_EXCEPTION : org.apache.synapse.SynapseException: Unexpected error sending message back
23:01:53,378 [-] [PassThroughMessageProcessor-4] WARN FaultHandler : org.apache.synapse.mediators.MediatorFaultHandler#111ce13
23:01:53,379 [-] [PassThroughMessageProcessor-4] WARN Executing fault handler mediator : fault
23:01:53,379 [-] [PassThroughMessageProcessor-4] INFO Start : Sequence <fault>
23:01:53,380 [-] [PassThroughMessageProcessor-4] INFO Sequence <SequenceMediator> :: mediate()
23:01:53,392 [-] [PassThroughMessageProcessor-4] ERROR Error while building message
23:15:56,619 [-] [http-nio-9443-exec-26] INFO Building Axis service for Proxy service : AdderServiceTCP
23:15:56,620 [-] [http-nio-9443-exec-26] INFO Loading the WSDL : <Inlined>
23:15:56,620 [-] [http-nio-9443-exec-26] INFO Did not find a WSDL. Assuming a POX or Legacy service
23:15:56,620 [-] [http-nio-9443-exec-26] INFO Exposing transports : [tcp]
23:15:56,621 [-] [http-nio-9443-exec-26] INFO Adding service AdderServiceTCP to the Axis2 configuration
23:15:56,675 [-] [http-nio-9443-exec-26] INFO Successfully created the Axis2 service for Proxy service : AdderServiceTCP
And the client shows:
[java] 13/04/27 23:48:58 ERROR tcp.TCPTransportSender: Error while processi
ng response
[java] org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOFException:
Unexpected EOF in prolog
[java] at [row,col {unknown-source}]: [1,0]
[java] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBui
lder.java:296)
[java] at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSO
APEnvelope(StAXSOAPModelBuilder.java:204)
[java] at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init
>(StAXSOAPModelBuilder.java:154)
[java] at org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAP
ModelBuilder(AbstractOMMetaFactory.java:73)
[java] at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPMode
lBuilder(AbstractOMMetaFactory.java:79)
[java] at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilde
r(OMXMLBuilderFactory.java:196)
[java] at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuil
der.java:55)
[java] at org.apache.axis2.transport.TransportUtils.createDocumentEleme
nt(TransportUtils.java:179)
[java] at org.apache.axis2.transport.TransportUtils.createSOAPMessage(T
ransportUtils.java:145)
[java] at org.apache.axis2.transport.tcp.TCPTransportSender.waitForRepl
y(TCPTransportSender.java:94)
[java] at org.apache.axis2.transport.tcp.TCPTransportSender.sendMessage
(TCPTransportSender.java:54)
[java] at org.apache.axis2.transport.base.AbstractTransportSender.invok
e(AbstractTransportSender.java:112)
[java] at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
[java] at org.apache.axis2.description.OutInAxisOperationClient.send(Ou
tInAxisOperation.java:398)
[java] at org.apache.axis2.description.OutInAxisOperationClient$NonBloc
kingInvocationWorker.run(OutInAxisOperation.java:434)
[java] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolE
xecutor.java:1110)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
Executor.java:603)
[java] at java.lang.Thread.run(Thread.java:722)
[java] Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prol
og
[java] at [row,col {unknown-source}]: [1,0]
[java] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanne
r.java:677)
[java] at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader
.java:2116)
[java] at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamR
eader.java:2022)
[java] at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java
:1114)
[java] at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.nex
t(XMLStreamReaderWrapper.java:225)
[java] at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamR
eaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
[java] at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.nex
t(XMLStreamReaderWrapper.java:225)
[java] at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StA
XOMBuilder.java:681)
[java] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBui
lder.java:214)
[java] ... 17 more
[java] 13/04/27 23:48:58 ERROR tcp.TCPTransportSender: Error while sending
a TCP request
[java] org.apache.axis2.AxisFault: Error while processing response
[java] at org.apache.axis2.transport.base.AbstractTransportSender.handl
eException(AbstractTransportSender.java:226)
[java] at org.apache.axis2.transport.tcp.TCPTransportSender.waitForRepl
y(TCPTransportSender.java:99)
[java] at org.apache.axis2.transport.tcp.TCPTransportSender.sendMessage
(TCPTransportSender.java:54)
[java] at org.apache.axis2.transport.base.AbstractTransportSender.invok
e(AbstractTransportSender.java:112)
[java] at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
[java] at org.apache.axis2.description.OutInAxisOperationClient.send(Ou
tInAxisOperation.java:398)
[java] at org.apache.axis2.description.OutInAxisOperationClient$NonBloc
kingInvocationWorker.run(OutInAxisOperation.java:434)
[java] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolE
xecutor.java:1110)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
Executor.java:603)
[java] at java.lang.Thread.run(Thread.java:722)
[java] Caused by: org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxEOF
Exception: Unexpected EOF in prolog
[java] at [row,col {unknown-source}]: [1,0]
[java] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBui
lder.java:296)
[java] at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSO
APEnvelope(StAXSOAPModelBuilder.java:204)
[java] at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init
>(StAXSOAPModelBuilder.java:154)
[java] at org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAP
ModelBuilder(AbstractOMMetaFactory.java:73)
[java] at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPMode
lBuilder(AbstractOMMetaFactory.java:79)
[java] at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilde
r(OMXMLBuilderFactory.java:196)Error inside callback : org.apache.axis2.AxisFaul
t: Error while sending a TCP request
[java]
[java] at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuil
der.java:55)
[java] at org.apache.axis2.transport.TransportUtils.createDocumentEleme
nt(TransportUtils.java:179)
[java] at org.apache.axis2.transport.TransportUtils.createSOAPMessage(T
ransportUtils.java:145)
[java] at org.apache.axis2.transport.tcp.TCPTransportSender.waitForRepl
y(TCPTransportSender.java:94)
[java] ... 8 more
[java] Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prol
og
[java] at [row,col {unknown-source}]: [1,0]
[java] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanne
r.java:677)
[java] at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader
.java:2116)
[java] at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamR
eader.java:2022)
[java] at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java
:1114)
[java] at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.nex
t(XMLStreamReaderWrapper.java:225)
[java] at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamR
eaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
[java] at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.nex
t(XMLStreamReaderWrapper.java:225)
[java] at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StA
XOMBuilder.java:681)
[java] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBui
lder.java:214)
[java] ... 17 more
**What I am doing wrong?
Thank you for help me.**
Have you enabled transport receiver configuration at client side? Looks like Client does not have a Transport listener for Tcp.
You need to have something like this in axis2.xml.
<transportReceiver name="tcp"
class="org.apache.axis2.transport.tcp.TCPServer">
<parameter name="port">6061</parameter>
Shelan.
At client side I have been enabled TCP transport receiver and sender:
<transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportListener">
<parameter name="transport.tcp.port">57000</parameter>
</transportReceiver>
<transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
However, using wireshark to monitoring the network communication, that TCP port is never used. I believe that enabling TCP listener at client side is not necessary. Right?
Thank you.
Shelan.
Based on your answer, I set the useSeparareListener property to true at client side. Now, all works fine!
For some strange reason I am getting the following exception.
2011-02-08 09:53:30,667 ERROR [STDERR] (QuartzScheduler_Worker-9) java.lang.ClassCastException: org.javassist.tmp.java.lang.Object_$$_javassist_seam_7 cannot be cast to no.kommuneforlaget.fagsystem.saksapp.service.report.SystemlogListener
2011-02-08 09:53:30,668 ERROR [STDERR] (QuartzScheduler_Worker-9) at no.kommuneforlaget.fagsystem.saksapp.jobs.ESBLogListener.checkESBEvents(ESBLogListener.java:71)
2011-02-08 09:53:30,668 ERROR [STDERR] (QuartzScheduler_Worker-9) at no.kommuneforlaget.fagsystem.saksapp.jobs.ESBLogListener.scheduler(ESBLogListener.java:119)
2011-02-08 09:53:30,668 ERROR [STDERR] (QuartzScheduler_Worker-9) at sun.reflect.GeneratedMethodAccessor466.invoke(Unknown Source)
2011-02-08 09:53:30,668 ERROR [STDERR] (QuartzScheduler_Worker-9) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2
I know it shouldn't be a class cast exception because its the correct class.
The code is:
SystemlogListener systemlogListener = (SystemlogListener) Component.getInstance("systemlogListener", ScopeType.SESSION, true);
And the class is
#Name("systemlogListener")
#Scope(ScopeType.SESSION)
#AutoCreate
#Stateful
#TransactionManagement(TransactionManagementType.CONTAINER) //default
#TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class SystemlogListener implements SystemlogListenerLocal, Serializable {
Can anyone spot the mistake I have made?
I assume that Component.getInstance(...) returning an injected class. The Implementation that is injected does not have to be of the class of your implementation but only of your Local/Remote interface.
So you could cast to your interface SystemlogListenerLocal but not to your implementation SystemlogListener.
The reason is the implementation of your AppServer which could use e.g. a proxy and delegates the methods to your real implementation.