[JBossWS] - HalloWorld Problem
by florian79
I got exceptions by tring a hallo world example
I use: jboss-4.2.0.GA with jbossws-1.2.1.GA (default WS)
My EJB- endpoint:
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebResult;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| //@WebService
| @WebService(name="HalloWorldWS")
| //@WebService(name="HalloWorldWS",serviceName="HalloWorldWSService")
| @SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
| //@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
| //@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
| @Stateless
| public class HalloWorldWSImpl implements HalloWorldWS
| {
| @WebMethod(operationName="getHalloWorld")
| @WebResult(name="hallo")
| public final String getHalloWorld()
| {
| return "Hallo Welt";
| }
|
| }
|
and my client unit test code:
| private void initByService() throws Exception
| {
| String strURL = "http://localhost:8080/HalloWorldWSImplService/HalloWorldWSImpl";
| String strQName = "HalloWorldWSImpl";
| URL url = new URL(strURL + "?wsdl");
| QName qname = new QName(strURL,strQName);
| Service service = Service.create(url, qname ); //here I get the exception!!!
| HalloWorldWS mySessionBean = service.getPort(HalloWorldWS.class);
| }
|
By using the SOAPBinding:
@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
I get the following exception:
| javax.xml.ws.WebServiceException: java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName
| at javax.xml.ws.Service.create(Service.java:731)
| at com.dooris.ws.HalloWorldWSImplTest.initByService(HalloWorldWSImplTest.java:41)
| at com.dooris.ws.HalloWorldWSImplTest.setUp(HalloWorldWSImplTest.java:22)
| 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:585)
| at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
| at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
| at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
| at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
| at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
| at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
| at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
| at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
| at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
| 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)
| Caused by: java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName
| at javax.xml.namespace.QName.<init>(QName.java:164)
| at javax.xml.namespace.QName.<init>(QName.java:113)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseExtensibilityAttributes(WSDLReaderImpl.java:1344)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseMessage(WSDLReaderImpl.java:1268)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:309)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2265)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2229)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2282)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335)
| at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:130)
| at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:83)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
| at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
| at javax.xml.ws.Service.<init>(Service.java:83)
| at org.jboss.ws.core.jaxws.client.ServiceExt.<init>(ServiceExt.java:60)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
| at javax.xml.ws.Service.create(Service.java:726)
| ... 22 more
|
By using the SOAPBinding:
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
or
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
I get the following exception:
| javax.xml.ws.WebServiceException: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorld'.
| at javax.xml.ws.Service.create(Service.java:731)
| at com.dooris.ws.HalloWorldWSImplTest.initByService(HalloWorldWSImplTest.java:41)
| at com.dooris.ws.HalloWorldWSImplTest.setUp(HalloWorldWSImplTest.java:22)
| 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:585)
| at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
| at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
| at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
| at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
| at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
| at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
| at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
| at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
| at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
| 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)
| Caused by: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorld'.
| at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:155)
| at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:83)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
| at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
| at javax.xml.ws.Service.<init>(Service.java:83)
| at org.jboss.ws.core.jaxws.client.ServiceExt.<init>(ServiceExt.java:60)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
| at javax.xml.ws.Service.create(Service.java:726)
| ... 22 more
| Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorld'.
| at com.ibm.wsdl.util.xml.DOMUtils.getQName(DOMUtils.java:309)
| at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedAttributeValue(DOMUtils.java:367)
| at com.ibm.wsdl.xml.WSDLReaderImpl.getQualifiedAttributeValue(WSDLReaderImpl.java:2019)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parsePart(WSDLReaderImpl.java:1278)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseMessage(WSDLReaderImpl.java:1257)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:309)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2265)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2229)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2282)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335)
| at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:130)
| ... 33 more
|
where is my stupide mistake?
Thank you!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060348#4060348
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060348
18Â years, 9Â months
[Remoting] - Config for EJB3 over servlet-invoker with compression
by MarcReis
Hi,
I am trying to get compression for the http communication between client and server.
We are using JBoss 4.2.0.
The communication over HTTP via the servlet-invoker works fine.
Now we wanted to add compression to it. So there are two points that I see were this could be done (three with apache in mind).(My primary question upfront: what am I missing for the CompressionMarshaller to work?)
1.) Add the compression="force" attribute in the jboss-web(tomcat) config for the http connector. (-> seems like application/octet-streams don?t get zipped)
2.) Use the org.jboss.remoting.marshal.compress.CompressingMarshaller/CompressingUnMarshaller (-> probably missing some config, nothing happens here) in the ejb3 connector.
For one I am wondering which would be best practice (if both is possible). In general I want to compress all there is.
I have tried numerous config permutations, but none offer the result I would expect.
Concerning the CompressingMarshaller it seems that I am missing some more config. I guess I need to somehow tell the servlet-invoker to talk gzip, since there is no difference with defining the CompressingMarshaller and "normal" communication.
When tomcat compression is enabled, it seems that some data is compressed, but the main payload is transmitted as application/octet-stream and does not seem to get compressed
I sniffed the communication with wire shark to see what is happening "down there". Just using the CompressionMarshaller shows no sign of gzip?ed data anywhere, so I guess I am somehow bypassing it.
Sincerely Marc
The config in ejb3-deployer/META-INF/jboss-service.xml
?
| <mbean code="org.jboss.remoting.transport.Connector"
| name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
| <depends>jboss.aop:service=AspectDeployer</depends>
| <attribute name="InvokerLocator">servlet://${jboss.bind.address}:8080/servlet-invoker/ServerInvokerServlet</attribu
| te>
| <attribute name="Configuration">
| <handlers>
| <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
| </handlers>
| <attribute name="dataType" isParam="true">serializable</attribute>
| <attribute name="marshaller" isParam="true">
| org.jboss.remoting.marshal.compress.CompressingMarshaller
| </attribute>
| <attribute name="unmarshaller" isParam="true">
| org.jboss.remoting.marshal.compress.CompressingUnMarshaller
| </attribute>
| </attribute>
| </mbean>
| ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060342#4060342
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060342
18Â years, 9Â months
[Remoting] - JNDIDetector removes detections
by aih1013
Hello!
I have a custom clustering system built on top of JBoss Remoting 2.2.0.SP4. It uses HAJndi and JNDIDetector to manage and discover nodes. HAJndi is hosted on cluster coordinators. Everything has worked fine until we had gone to pre-production state.
The network load has increased, and central nodes began to treat slave nodes as dead and remove them from the registry. However at this moment, the slave nodes communicate with the coordinators without any problem. So this is not a hardware failure. Also, I can setup TCP connection from a coordinator node to the lost slave node by telnet at the moment of failures.
Below you can see a quote from the log. It seems the slave and the master race with each other to remove/insert detection object to JNDI.
anonymous wrote :
| 2007-07-04 10:04:50,406 DEBUG [org.jboss.remoting.detection.jndi.JNDIDetector] Removed detection Detection (org.jboss.remoting.detection.Detection@8cddac31)
| 2007-07-04 10:05:56,848 DEBUG [org.jboss.remoting.detection.jndi.JNDIDetector] Removed detection Detection (org.jboss.remoting.detection.Detection@8cddac31)
| 2
|
The first thing I've found during Remoting code review is small timeout for connection validation and only 1 retry number. I'm going to patch the code and check if this will solve the problem. But I suppose there was a cause why the timeout is so small. And this does not seem as an appropriate solution anyway.
I have another unusual artifact in slaves log:
anonymous wrote :
| 2007-07-04 00:00:56,447 INFO [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] Received version 254: treating as end of file
| 2007-07-04 00:00:56,447 INFO [org.jboss.remoting.transport.socket.MicroSocketClientInvoker] Received version 254: treating as end of file
|
May be this connected with the first problem? What is this?
Any hints or advances ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060341#4060341
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060341
18Â years, 9Â months
[JNDI/Naming/Network] - JNDI Connection Problem! jboss.bind.address always 127.0.0.1
by cjc
Hi,
I'm using JBoss 4.0.5.GA and now i wont to migrate to 4.2.0.GA. I'm using
some java bigger 1.5.
My architectuer looks like
PC A) eth0: 192.168.200.210 (dbserver)
Jboss4.0.5.GA
MySQL
PC B) eth1: 192.168.200.211 and eth0: INET (XXX.XXX.XXX.XXX)
Tomcat 5.5
My jndi.propterties on PC B looks like:
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=jnp://dbserver:1099
|
All that works greate with 4.0.5.GA. But under 4.2.0.GA dosn't!!!
I edit the file conf/jboss-service.xml and make all Bindings where
$(jboss.bind.address) is using to Empty == ALL but the result was
that telnet can connect to dbserver:1099 but get a address 127.0.0.1 to go forward. So my Tomcat cannont establich jndi Connections?
If i add the parameter -Djboss.bind.address=0.0.0.0 it changed nothing!
Even jboss.bind.address=dbserver or the IP.
If im just to stupid read right the manual say me where to look!
Do I have to use the bind-service.xml to do that?
regards
cjc
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060338#4060338
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060338
18Â years, 9Â months