[Remoting] - Remoting via mbean issue
by ucfjeff
We are attempting to deploy a Jboss Remoting Server as an mbean using JBossRemoting-2_0_0_GA on Jboss-4.0.4 jdk1.5.
We have used the following classes provided in the tests package as is:
org.jboss.test.remoting.handler.mbean.service.ClientTest:
| public class ClientTest {
| private static String transport = "socket";
| private static String host = "localhost";
| private static int port = 5400;
| public void makeInvocation(String locatorURI) throws Throwable {
| InvokerLocator locator = new InvokerLocator(locatorURI);
| System.out.println("Calling remoting server with locator uri of: " + locatorURI);
| Client remotingClient = new Client(locator);
| remotingClient.connect();
| Object response = remotingClient.invoke("Do something");
| System.out.println("Invocation response: " + response);
| }
| public static void main(String[] args) {
| if(args != null && args.length == 2) {
| transport = args[0];
| port = Integer.parseInt(args[1]);
| }
| String locatorURI = transport + "://" + host + ":" + port;
| ClientTest clientTest = new ClientTest();
| try {
| clientTest.makeInvocation(locatorURI);
| }
| catch(Throwable e) {
| e.printStackTrace();
| }
| }
| }
|
org.jboss.test.remoting.handler.mbean.MBeanHandler:
| public class MBeanHandler implements MBeanHandlerMBean {
| private MBeanServer server = null;
| private ServerInvoker invoker = null;
| public void setMBeanServer(MBeanServer server) {
| this.server = server;
| }
| public void setInvoker(ServerInvoker invoker) {
| this.invoker = invoker;
| }
| public Object invoke(InvocationRequest invocation) throws Throwable {
| System.out.println(invocation.getParameter());
| return ServerTest.RESPONSE_VALUE;
| }
| public void addListener(InvokerCallbackHandler callbackHandler) { }
| public void removeListener(InvokerCallbackHandler callbackHandler) { }
| void create() throws Exception { }
| void start() throws Exception { }
| void stop() { }
| void destroy() { }
| }
|
mbeanhandler-service.xml:
| <server>
| <classpath codebase="lib" archives="*"/>
| <mbean code="org.jboss.remoting.network.NetworkRegistry"
| name="jboss.remoting:service=NetworkRegistry"/>
| <mbean code="org.jboss.remoting.samples.simple.MBeanHandler"
| name="test:type=handler"/>
| <mbean code="org.jboss.remoting.transport.Connector"
| xmbean-dd="org/jboss/remoting/transport/Connector.xml"
| name="jboss.remoting:service=Connector,transport=Socket"
| display-name="Socket transport Connector">
| <attribute name="Configuration">
| <config>
| <invoker transport="socket">
| <attribute name="numAcceptThreads">1</attribute>
| <attribute name="maxPoolSize">303</attribute>
| <attribute name="clientMaxPoolSize" isParam="true">304</attribute>
| <attribute name="socketTimeout">60000</attribute>
| <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
| <attribute name="serverBindPort">5400</attribute>
| <attribute name="enableTcpNoDelay" isParam="true">false</attribute>
| <attribute name="backlog">200</attribute>
| </invoker>
| <handlers>
| <handler subsystem="test">test:type=handler</handler>
| </handlers>
| </config>
| </attribute>
| </mbean>
| </server>
|
The mbean deploys as expected, however when we run the client we receive the following:
Client Side:
| [java] Calling remoting server with locator uri of: socket://localhost:5400
| [java] Invoking server with request of 'Do something'
| [java] 10:53:50,634 [ERROR] org.jboss.remoting.transport.socket.SocketClientInvoker: Got marshalling exception, exiting
| [java] java.net.SocketException
| [java] at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:348)
| [java] at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:116)
| [java] at org.jboss.remoting.Client.invoke(Client.java:612)
| [java] at org.jboss.remoting.Client.invoke(Client.java:604)
| [java] at org.jboss.remoting.Client.invoke(Client.java:589)
| [java] at org.jboss.remoting.samples.simple.SimpleClient.makeInvocation(Unknown Source)
| [java] at org.jboss.remoting.samples.simple.SimpleClient.main(Unknown Source)
| [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| [java] at java.lang.reflect.Method.invoke(Method.java:585)
| [java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:202)
| [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:134)
| [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:710)
| [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:178)
| [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84)
| [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
| [java] at org.apache.tools.ant.Task.perform(Task.java:364)
| [java] at org.apache.tools.ant.Target.execute(Target.java:341)
| [java] at org.apache.tools.ant.Target.performTasks(Target.java:369)
| [java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
| [java] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
| [java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
| [java] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
| [java] at org.apache.tools.ant.Main.runBuild(Main.java:668)
| [java] at org.apache.tools.ant.Main.startAnt(Main.java:187)
| [java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
| [java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
| [java] java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
| [java] java.net.SocketException
| [java] at org.jboss.remoting.transport.socket.SocketClientInvoker.handleException(SocketClientInvoker.java:118)
| [java] at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:400)
| [java] at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:116)
| [java] at org.jboss.remoting.Client.invoke(Client.java:612)
| [java] at org.jboss.remoting.Client.invoke(Client.java:604)
| [java] at org.jboss.remoting.Client.invoke(Client.java:589)
| [java] at org.jboss.remoting.samples.simple.SimpleClient.makeInvocation(Unknown Source)
| [java] at org.jboss.remoting.samples.simple.SimpleClient.main(Unknown Source)
|
Server Side:
| 10:53:50,618 DEBUG [ServerThread] beginning dorun
| 10:53:50,618 ERROR [ServerThread] failed to process invocation.
| java.io.OptionalDataException
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1310)
| at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
| at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
| at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:350)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
| 10:53:50,618 DEBUG [ServerThread] begin thread wait
| 10:53:50,618 DEBUG [ServerThread] WAKEUP in SERVER THREAD
|
Is there anything we are overlooking? Any assistance is greatly appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016550#4016550
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016550
19Â years, 2Â months
[JBossWS] - Bug? operations from doc-literal BARE to WRAPPED
by bocio
Hi all,
I'm completely stuck on this, please could you confirm thsi is a bug or where I'm wrong?
I'm using JBossWS1.0.4 as client of an Axis2 service. Until now everything was ok, then...
I removed two methods from a working POJO class exposed as WS and I started getting a ClassCastException at runtime on my JBoss JSR109 client side calling the remaining methods. Suddendly all my operations are seen as "doc-literal wrapped"
For example:
| public String getConfigurationFile ()
| {
| return "abracadabra";
| }
|
This is the Exception trace:
| 2007-02-14 15:17:04,896 TRACE [jbossws.SOAPMessage] Incoming Response SOAPMessage
| <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
| <soapenv:Header/>
| <soapenv:Body>
| <ns:getConfigurationFileResponse xmlns:ns='http://neo.spectre.com/xsd'>
| <ns:_return>abracadabra</ns:_return>
| </ns:getConfigurationFileResponse>
| </soapenv:Body>
| </soapenv:Envelope>
| 2007-02-14 15:17:04,896 DEBUG [org.jboss.ws.common.CommonSOAPBinding] unbindResponseMessage: {http://neo.spectre.com}getConfigurationFile
| 2007-02-14 15:17:04,912 DEBUG [org.jboss.ws.binding.EndpointInvocation] setReturnValue: org.jboss.ws.soap.SOAPBodyElementDoc
| 2007-02-14 15:17:04,912 DEBUG [org.jboss.ws.binding.EndpointInvocation] getReturnValue
| 2007-02-14 15:17:04,912 DEBUG [org.jboss.ws.soap.SOAPContentElement] getObjectValue [xmlType={http://neo.spectre.com/xsd}>getConfigurationFileResponse,javaType=class com.spectre.neo.GetConfigurationFileResponse]
| 2007-02-14 15:17:04,912 DEBUG [org.jboss.ws.jbossxb.JBossXBDeserializer] deserialize: [xmlName={http://neo.spectre.com/xsd}getConfigurationFileResponse,xmlType=...>getConfigurationFileResponse]
| 2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.jbossxb.JBossXBDeserializer] deserialized: com.spectre.neo.GetConfigurationFileResponse
| 2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.soap.SOAPContentElement] objectValue: com.spectre.neo.GetConfigurationFileResponse
| 2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.binding.EndpointInvocation] transformPayloadValue: org.jboss.ws.soap.SOAPBodyElementDoc -> com.spectre.neo.GetConfigurationFileResponse
| 2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.jaxrpc.ParameterWrapping] unwrapResponseParameter: com.spectre.neo.GetConfigurationFileResponse
| 2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.jaxrpc.ParameterWrapping] get_return: java.lang.String
| 2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.soap.MessageContextAssociation] popMessageContext: org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC@1f7be7b
| 2007-02-14 15:17:04,928 ERROR [com.spectre.web.neo.FrontController] Command execute exception
| java.lang.ClassCastException: java.lang.String
| at $Proxy56.getConfigurationFile(Unknown Source)
| at com.spectre.web.neo.adapter.ConfigurationFileAdapter.getData(ConfigurationFileAdapter.java:35)
| at com.spectre.web.neo.commands.FileConfigCommand.execute(FileConfigCommand.java:46)
| at com.spectre.web.neo.FrontController.processRequest(FrontController.java:107)
| at com.spectre.web.neo.FrontController.doGet(FrontController.java:66)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
|
I enabled JBossWS logs and I started digging...
If I insert again the two methods in my POJO WS and I generate again WSDL and client artifacts, this is the happy day scenario:
| 2007-02-14 15:56:45,897 TRACE [jbossws.SOAPMessage] Incoming Response SOAPMessage
| <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
| <soapenv:Header/>
| <soapenv:Body>
| <ns:getConfigurationFileResponse xmlns:ns='http://neo.spectre.com/xsd'>
| <ns:_return>abracadabra</ns:_return>
| </ns:getConfigurationFileResponse>
| </soapenv:Body>
| </soapenv:Envelope>
| 2007-02-14 15:56:45,897 DEBUG [org.jboss.ws.common.CommonSOAPBinding] unbindResponseMessage: {http://neo.spectre.com}getConfigurationFile
| 2007-02-14 15:56:45,897 DEBUG [org.jboss.ws.binding.EndpointInvocation] setReturnValue: org.jboss.ws.soap.SOAPBodyElementDoc
| 2007-02-14 15:56:45,897 DEBUG [org.jboss.ws.binding.EndpointInvocation] getReturnValue
| 2007-02-14 15:56:45,897 DEBUG [org.jboss.ws.soap.SOAPContentElement] getObjectValue [xmlType={http://neo.spectre.com/xsd}>getConfigurationFileResponse,javaType=class com.spectre.neo.GetConfigurationFileResponse]
| 2007-02-14 15:56:45,897 DEBUG [org.jboss.ws.jbossxb.JBossXBDeserializer] deserialize: [xmlName={http://neo.spectre.com/xsd}getConfigurationFileResponse,xmlType=...>getConfigurationFileResponse]
| 2007-02-14 15:56:45,912 DEBUG [org.jboss.ws.jbossxb.JBossXBDeserializer] deserialized: com.spectre.neo.GetConfigurationFileResponse
| 2007-02-14 15:56:45,912 DEBUG [org.jboss.ws.soap.SOAPContentElement] objectValue: com.spectre.neo.GetConfigurationFileResponse
| 2007-02-14 15:56:45,912 DEBUG [org.jboss.ws.binding.EndpointInvocation] transformPayloadValue: org.jboss.ws.soap.SOAPBodyElementDoc -> com.spectre.neo.GetConfigurationFileResponse
| 2007-02-14 15:56:45,912 DEBUG [org.jboss.ws.soap.MessageContextAssociation] popMessageContext: org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC@126b165
| 2007-02-14 15:56:45,912 DEBUG [com.spectre.web.neo.adapter.ConfigurationFileAdapter] reply: abracadabra
|
I compared the two WSDL before and after the two method inserted and nothing is changed for the getConfigurationFile() method. (I can post them, if needed).
Looking into the JBoss logs I discovered that on the correct scenario all operations are seen as doc-literal BARE
| OperationMetaData:
| qname={http://neo.spectre.com}getConfigurationFile
| javaName=getConfigurationFile
| style=document/literal/BARE
| oneWay=false
| soapAction=urn:getConfigurationFile
| ReturnMetaData:
| xmlName={http://neo.spectre.com/xsd}getConfigurationFileResponse
| xmlType={http://neo.spectre.com/xsd}>getConfigurationFileResponse
| javaType=com.spectre.neo.GetConfigurationFileResponse
| mode=OUT
| inHeader=false
| wrappedVariables=[]
| wrappedTypes=[]
| wrappedElementNames=[]
When I'm getting thw ClassCastException the same operation is seen as doc-literal WRAPPED:
| OperationMetaData:
| qname={http://neo.spectre.com}getConfigurationFile
| javaName=getConfigurationFile
| style=document/literal/WRAPPED
| oneWay=false
| soapAction=urn:getConfigurationFile
| ReturnMetaData:
| xmlName={http://neo.spectre.com/xsd}getConfigurationFileResponse
| xmlType={http://neo.spectre.com/xsd}>getConfigurationFileResponse
| javaType=com.spectre.neo.GetConfigurationFileResponse
| mode=OUT
| inHeader=false
| wrappedVariables=[_return]
| wrappedTypes=[]
| wrappedElementNames=[]
|
thank you in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016547#4016547
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016547
19Â years, 2Â months
MDB failing to deploy with ClassCastException
by Alex Pounds
Hello,
I've been working on the deployment setup for a J2EE app we've been
developing in-house, and have hit an impasse with my EAR file. On
deployment, I get a ClassCastException from my message-driven bean:
17:55:51,859 ERROR [ExceptionInterceptor] Caught RuntimeException
java.lang.ClassCastException: org.jboss.jms.destination.JBossQueue
at
org.jboss.jms.client.container.AsfAspect.handleCreateConnectionConsumer(AsfAspect.java:111)
[Full stacktrace at http://pastie.caboo.se/40302]
I understand that I may get a ClassCastException if I was trying to load
JBossQueue from two separate class loaders, but I only have one instance
of jboss-messaging-client.jar in my system (in the container's lib/
directory) so I don't think that's the problem.
I'm not sure what further information to provide to help diagnose this
issue, so please do ask questions if needed.
Thank you,
--
Alex Pounds .~. Framestore CFC
Systems Developer /V\
// \\
"Variables won't; Constants aren't" /( )\
^`~'^
19Â years, 2Â months