socket problem, seem to cause asynchoronous invocation error(with ethereal capture)
by Da Feng
hello everyone:
I deployed a test case to demonstrate jax-ws2.0,but find that jbossws' asynchronous client invocation throws a classcast exception. But the packet capture seems all right. One thing abnormal is that with jbossws 2.0.2, there is always a "broken pipe" exception thrown by container, and packet capture shows a tcp RST from client to server. With 2.0.3, it works all right with synchronous call. I used wsconsume with customization to get asynchronous stub.
The packet capture is the communication process, the zip is project with a war archive, which is my webservice.
Can some one help me? My little demonstration is pending.
stack trace.
done
java.lang.ClassCastException: jboss.wsconsume.gen.hotelbooking.stub.Tickets
at sunspider.jaxws20.tutorial.client.TestJAXWS20DynaClient.hanldeResponse1(TestJAXWS20DynaClient.java:95)
at sunspider.jaxws20.tutorial.client.TestJAXWS20DynaClient.testBookingAsync(TestJAXWS20DynaClient.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Tear Down
Tear Down
java.lang.ClassCastException: jboss.wsconsume.gen.hotelbooking.stub.Tickets
at sunspider.jaxws20.tutorial.client.TestJAXWS20DynaClient.hanldeResponse1(TestJAXWS20DynaClient.java:95)
at sunspider.jaxws20.tutorial.client.TestJAXWS20DynaClient.access$0(TestJAXWS20DynaClient.java:92)
at sunspider.jaxws20.tutorial.client.TestJAXWS20DynaClient$1.handleResponse(TestJAXWS20DynaClient.java:114)
at org.jboss.ws.core.jaxws.client.ClientProxy$AsyncRunnable.run(ClientProxy.java:264)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
DaFENG
Coder
Telecommunication && Network Industry
Pudong
Shanghai
China
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
16 years, 8 months
[JBossWS] - Re: How can I use session sope in jbossws?
by froden
You mean for the webservice? This is the interface:
package services;
|
| import javax.jws.WebMethod;
| import javax.jws.WebParam;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| @WebService(
| name = "EndpointInterface",
| targetNamespace = "http://mynamespace/xml"
| )
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| public interface UserService {
| @WebMethod(operationName = "registerUser", action = "urn:registerUser")
| public String registerUser(
| @WebParam(name = "nickname") String nickname,
| @WebParam(name = "password") String password,
| @WebParam(name = "email") String email
| );
| }
And the implementation:
package services;
|
| import javax.annotation.Resource;
| import javax.ejb.EJB;
| import javax.ejb.EJBContext;
| import javax.ejb.Stateless;
| import javax.jws.WebService;
| import javax.naming.InitialContext;
| import javax.servlet.http.HttpSession;
| import javax.xml.ws.WebServiceContext;
| import javax.xml.ws.WebServiceException;
| import javax.xml.ws.handler.MessageContext;
|
| import org.jboss.ws.annotation.WebContext;
| import org.jboss.ws.core.CommonMessageContext;
| import org.jboss.ws.core.jaxws.WebServiceContextEJB;
| import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
| import org.jboss.ws.core.soap.MessageContextAssociation;
|
| @WebService(
| endpointInterface = services.UserService",
| serviceName = "UserService"
| )
| @WebContext(contextRoot="/ws", urlPattern="/UserService")
| @Stateless
| public class UserServiceImpl implements UserService {
|
| WebServiceContext wsContext;
|
| @Resource
| EJBContext ejbCtx;
| public String registerUser(String nickname, String password, String email) {
|
| CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
| wsContext = new WebServiceContextEJB((SOAPMessageContextJAXWS)msgContext, ejbCtx);
| MessageContext mc = wsContext.getMessageContext();
|
| HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
|
| if (session == null)
| throw new WebServiceException("No session in WebServiceContext");
|
| String[] names = session.getValueNames();
| System.out.println("There are " + names.length + " variables in the session.");
| for(int i = 0; i < names.length; i++) {
| System.out.println("We have a session variable called " + names[ i ] + " holding the value " + session.getAttribute(names[ i ]));
| }
|
| // Get a session property "counter" from context
| Integer counter = (Integer)session.getAttribute("counter");
| if (counter == null) {
| counter = new Integer(0);
| System.out.println("Starting the Session");
| }
|
| System.out.println("Session id is: " + session.getId());
| counter = new Integer(counter.intValue() + 1);
| session.setAttribute("counter", counter);
|
| System.out.println("Counter is: " + counter);
| return "blabla";
| }
|
| }
Sorry about the mess hehe
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125093#4125093
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125093
16 years, 8 months
[JBossWS] - Error on java.lang.IllegalStateException: Cannot build JAXB
by smathankumar
Hi,
I created a Java WebService implementation java file named as DeviceServiceEventBroker.java with JAX-WS annotations. My Java WebService implementation file is implements with an interface named as DeviceOmi.java of my Web Service class. And My Interface class is extends with the java.io.Serializable.
I am not able to generate the wsdl from java. I got the below error. Any idea? Is there any option to use my Implemtation class with out the extends classes.
D:\MCP-2008\classes>"C:\Program Files\Java\jdk1.6.0_02\bin\java" -Djava.endorsed.dirs="D:\jboss-4.2.2.GA\bin\\..\lib\endorsed" -Dlog4j.configuration=
wstools-log4j.xml -classpath ";D:\jboss-4.2.2.GA\bin\\../client/jboss-xml-binding.jar;D:\jboss-4.2.2.GA\bin\\../client/activation.jar;D:\jboss-4.2.2.G
A\bin\\../client/javassist.jar;D:\jboss-4.2.2.GA\bin\\../client/getopt.jar;D:\jboss-4.2.2.GA\bin\\../client/jaxb-api.jar;D:\jboss-4.2.2.GA\bin\\../cli
ent/jaxb-impl.jar;D:\jboss-4.2.2.GA\bin\\../client/jbossall-client.jar;D:\jboss-4.2.2.GA\bin\\../client/jbossws-client.jar;D:\jboss-4.2.2.GA\bin\\../c
lient/jboss-jaxws.jar;D:\jboss-4.2.2.GA\bin\\../client/jboss-jaxrpc.jar;D:\jboss-4.2.2.GA\bin\\../client/jboss-saaj.jar;D:\jboss-4.2.2.GA\bin\\../clie
nt/log4j.jar;D:\jboss-4.2.2.GA\bin\\../client/mail.jar;D:\jboss-4.2.2.GA\bin\\../client/jbossws-spi.jar" org.jboss.wsf.spi.tools.cmd.WSProvide --show-
traces -o D:\MCP-2008\wsdl -w com.nortelnetworks.mcp.ne.sm.svc.device.impl.DeviceServiceEventBroker
Output directory: D:\MCP-2008\wsdl
Source directory: D:\MCP-2008\wsdl
Generating WSDL:
log4j:WARN No appenders could be found for logger (org.jboss.wsf.framework.DefaultSPIProvider).
log4j:WARN Please initialize the log4j system properly.
Error: Could not generate. (use --show-traces to see full traces)
java.lang.IllegalStateException: Cannot build JAXB context
at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder.java:944) at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:146)
at org.jboss.ws.tools.jaxws.impl.JBossWSProviderImpl.provide(JBossWSProviderImpl.java:108)
at org.jboss.ws.tools.jaxws.impl.JBossWSProviderImpl.provide(JBossWSProviderImpl.java:124)
at org.jboss.wsf.spi.tools.cmd.WSProvide.generate(WSProvide.java:184)
at org.jboss.wsf.spi.tools.cmd.WSProvide.main(WSProvide.java:77)
Caused by: org.jboss.ws.WSException: Failed to create JAXBContext
at org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFactory.java:111)
at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder.java:935)
... 5 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.io.Serializable is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at java.io.Serializable
at public java.io.Serializable com.nortelnetworks.mcp.ne.share.svc.filter.data.PropertyFilterDataObject.getPropertyValue()
at com.nortelnetworks.mcp.ne.share.svc.filter.data.PropertyFilterDataObject
at public com.nortelnetworks.mcp.ne.share.svc.filter.data.PropertyFilterDataObject[] com.nortelnetworks.mcp.ne.share.svc.filter.data.F
ilterDataObject.getPropertyFilters()
at com.nortelnetworks.mcp.ne.share.svc.filter.data.FilterDataObject
at com.nortelnetworks.mcp.ne.share.svc.device.data.DeviceMtcDataFilter
at private com.nortelnetworks.mcp.ne.share.svc.device.data.DeviceMtcDataFilter com.nortelnetworks.mcp.ne.sm.svc.device.impl.jaxws.GetF
ilteredDeviceListFromIPCM.arg1
at com.nortelnetworks.mcp.ne.sm.svc.device.impl.jaxws.GetFilteredDeviceListFromIPCM
java.io.Serializable does not have a no-arg default constructor.
this problem is related to the following location:
at java.io.Serializable
at public java.io.Serializable com.nortelnetworks.mcp.ne.share.svc.filter.data.PropertyFilterDataObject.getPropertyValue()
at com.nortelnetworks.mcp.ne.share.svc.filter.data.PropertyFilterDataObject
at public com.nortelnetworks.mcp.ne.share.svc.filter.data.PropertyFilterDataObject[] com.nortelnetworks.mcp.ne.share.svc.filter.data.F
ilterDataObject.getPropertyFilters()
at com.nortelnetworks.mcp.ne.share.svc.filter.data.FilterDataObject
at com.nortelnetworks.mcp.ne.share.svc.device.data.DeviceMtcDataFilter
at private com.nortelnetworks.mcp.ne.share.svc.device.data.DeviceMtcDataFilter com.nortelnetworks.mcp.ne.sm.svc.device.impl.jaxws.GetF
ilteredDeviceListFromIPCM.arg1
at com.nortelnetworks.mcp.ne.sm.svc.device.impl.jaxws.GetFilteredDeviceListFromIPCM
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:286)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)
at org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFactory.java:102)
... 6 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4125071#4125071
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4125071
16 years, 8 months