[JBossWS] - NullPointerException while using JBossWS 1.0.4.GA
by vink
hello,
Please find attached the details of the exception while I've deployed my service (which was running fine on old release)
I've upgraded to JBossWS 1.0.4.GA & the problem starts..
I'm using JBoss 4.0.5.GA, it starts without any problem. But, when I deploy my service package it throws a NullPointerException.
Then during investigation, I tried to access JBossWS Web Console. But, when I try to list the services - it again thows me an exception.
19:40:04,217 ERROR [MainDeployer] Could not create deployment: file:/C:/Lang/JBoss/jboss-4.0.5.GA/server/default/deploy/DisplayManagementAPI.ejb3
java.lang.NullPointerException
at org.jboss.ws.integration.jboss.DeployerInterceptor.getServiceEndpointDeployer(DeployerInterceptor.java:142)
at org.jboss.ws.integration.jboss.DeployerInterceptor.create(DeployerInterceptor.java:80)
at org.jboss.ws.integration.jboss.DeployerInterceptorEJB.create(DeployerInterceptorEJB.java:44)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
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:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy30.create(Unknown Source)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
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:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019955#4019955
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019955
17 years, 11 months
[JBossWS] - JAXB error when using different derived types in the same co
by javaslag
I have what seems to be a correct piece of SOAP being sent to JBossWS 1.0.4 that causes a binding exception. This only occurs when I send 2 different sub-class/derived types in the same container type. Sending each type independently (or several instances of the same type) works fine.
In my example I have a Transaction type that contains an unbound number of Atoms, where Atom is an abstract type. There are 2 derivative of Atom, AtomType1 and AtomType2 which each extend Atom and add an additional sub-element element unique to the specialised type.
(You can assume the namespaces/jax-rpc mapping is correct as when used independently from each other, the derived types bind fine.)
My Types...
| <complexType abstract="true" name="Atom">
| <sequence>
| <element name="atom_id" type="nonNegativeInteger" />
| <element name="name" nillable="true" type="string" />
| </sequence>
| </complexType>
|
| <complexType name="Transaction">
| <sequence>
| <element maxOccurs="unbounded" name="atom" type="myns:Atom" />
| </sequence>
| </complexType>
|
|
| <complexType name="AtomType1">
| <complexContent>
| <extension base="myns:Atom">
| <sequence>
| <element name="atom_type_1_value" type="unsignedLong" />
| </sequence>
| </extension>
| </complexContent>
| </complexType>
|
| <complexType name="AtomType2">
| <complexContent>
| <extension base="myns:Atom">
| <sequence>
| <element name="atom_type_2_value" type="unsignedLong" />
| </sequence>
| </extension>
| </complexContent>
| </complexType>
First example which is processed fine, and proves the type is bound correctly. Single Atom in the Transaction
<?xml version="1.0" encoding="UTF-8"?>
| <env:Envelope
| xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
| xmlns:ns0="http://mynamespace">
|
| <env:Body>
| <ns0:update>
| <Transaction_1>
|
| <atom xmlns:ans1="http://mynamespace" xsi:type="ans1:AtomType2">
| <atom_id>1</atom_id>
| <name>myName2</name>
| <atom_type_2_value>2</atom_type_2_value>
| </atom>
|
| </Transaction_1>
| </ns0:update>
| </env:Body>
| </env:Envelope>
The next Transaction contains 2 different Atom derived types, and fails processing with this exception
Error: anonymous wrote : org.jboss.ws.binding.BindingException: org.jboss.ws.jbossxb.UnmarshalException: Failed to parse source: Requested element atom_type_2_value is not allowed in this position in the sequence. A model group with minOccurs=1 that doesn't contain this element must follow.
<?xml version="1.0" encoding="UTF-8"?>
| <env:Envelope
| xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
| xmlns:ns0="http://mynamespace">
|
| <env:Body>
| <ns0:update>
| <Transaction_1>
|
| <atom xmlns:ans1="http://mynamespace" xsi:type="ans1:AtomType1">
| <atom_id>1</atom_id>
| <name>myName</name>
| <atom_type_1_value>2</atom_type_1_value>
| </atom>
|
| <atom xmlns:ans1="http://mynamespace" xsi:type="ans1:AtomType2">
| <atom_id>2</atom_id>
| <name>myName2</name>
| <atom_type_2_value>2</atom_type_2_value>
| </atom>
|
| </Transaction_1>
| </ns0:update>
| </env:Body>
| </env:Envelope>
Just for a test, I switched the order of the Atoms in the transaction and note that the binding exception is now accredited to the other derived type
Error: anonymous wrote : org.jboss.ws.binding.BindingException: org.jboss.ws.jbossxb.UnmarshalException: Failed to parse source: Requested element atom_type_1_value is not allowed in this position in the sequence. A model group with minOccurs=1 that doesn't contain this element must follow.
<?xml version="1.0" encoding="UTF-8"?>
| <env:Envelope
| xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
| xmlns:ns0="http://mynamespace">
|
| <env:Body>
| <ns0:update>
| <Transaction_1>
|
| <atom xmlns:ans1="http://mynamespace" xsi:type="ans1:AtomType2">
| <atom_id>1</atom_id>
| <name>myName</name>
| <atom_type_1_value>2</atom_type_1_value>
| </atom>
|
| <atom xmlns:ans1="http://mynamespace" xsi:type="ans1:AtomType1">
| <atom_id>2</atom_id>
| <name>myName2</name>
| <atom_type_2_value>2</atom_type_2_value>
| </atom>
|
| </Transaction_1>
| </ns0:update>
| </env:Body>
| </env:Envelope>
The final Transaction contains 2 atoms of the same derived type - and is processed fine.
<?xml version="1.0" encoding="UTF-8"?>
| <env:Envelope
| xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
| xmlns:ns0="http://mynamespace">
|
| <env:Body>
| <ns0:update>
| <Transaction_1>
|
| <atom xmlns:ans1="http://mynamespace" xsi:type="ans1:AtomType1">
| <atom_id>1</atom_id>
| <name>myName</name>
| <atom_type_1_value>2</atom_type_1_value>
| </atom>
|
| <atom xmlns:ans1="http://mynamespace" xsi:type="ans1:AtomType1">
| <atom_id>2</atom_id>
| <name>myName2</name>
| <atom_type_2_value>2</atom_type_2_value>
| </atom>
|
| </Transaction_1>
| </ns0:update>
| </env:Body>
| </env:Envelope>
Worth raising a bug?
Regards - J
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019863#4019863
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019863
17 years, 11 months
[JBossWS] - Problems ejb call and jaxrpc / principal
by penguine
Hallo Thomas,
The HelloBean in my/your example:
String urlstr = "http://localhost:8080/ws/RoleSecured?wsdl";
String argument = "testmich";
System.out.println("Contacting webservice at " + urlstr);
URL url = new URL(urlstr);
QName qname = new QName("http://hello.ws.jboss.org/", "HelloService");
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(url, qname);
Hello hello = (Hello) service.getPort(Hello.class);
Stub stub = (Stub) hello;
stub._setProperty(Stub.USERNAME_PROPERTY, "kermit");
stub._setProperty(Stub.PASSWORD_PROPERTY, "thefrog");
System.out.println("hello.hello(" + argument + ")");
System.out.println("output:" + hello.hello(argument)); <-- here the exception occurs
I become the following error:
Contacting webservice at http://localhost:8080/ws/RoleSecured?wsdl
hello.hello(testmich)
java.rmi.RemoteException: Call invocation failed with code [Client] because of: java.rmi.AccessException: SecurityException; nested exception is:
java.lang.SecurityException: Insufficient method permissions, principal=null, ejbName=HelloBean, method=hello, interface=SERVICE_ENDPOINT, requiredRoles=[friend], principalRoles=[]; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: java.rmi.AccessException: SecurityException; nested exception is:
java.lang.SecurityException: Insufficient method permissions, principal=null, ejbName=HelloBean, method=hello, interface=SERVICE_ENDPOINT, requiredRoles=[friend], principalRoles=[]
at org.jboss.ws.common.CommonClient.invoke(CommonClient.java:331)
at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:560)
at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:338)
at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:148)
at $Proxy0.hello(Unknown Source)
at de.mycompany.it.webservice.test.TestHelloClientII.main(TestHelloClientII.java:67)
Caused by: javax.xml.rpc.soap.SOAPFaultException: java.rmi.AccessException: SecurityException; nested exception is:
java.lang.SecurityException: Insufficient method permissions, principal=null, ejbName=HelloBean, method=hello, interface=SERVICE_ENDPOINT, requiredRoles=[friend], principalRoles=[]
at org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper.getSOAPFaultException(SOAPFaultExceptionHelper.java:100)
at org.jboss.ws.common.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:574)
at org.jboss.ws.common.CommonClient.invoke(CommonClient.java:319)
... 5 more
Exception in thread "main"
If I do a normal lookup to my bean as you do it in your examples it works.
But if I try to use the webserver to access the wsdl like my example above I don´t have a valid principal setting.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019457#4019457
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019457
17 years, 11 months