[JBossWS] - Re: Jbossws.1.2.1.GA... JNDI Bind Failed:JAXR
by KuppanChinna1979
Hi,
The [JUDDIService] JNDI Bind Failed:JAXR error comes when BindJaxr in
"jboss-4.0.4.GA/server/default//deploy/juddi-service.sar/meta-inf/jboss-service.xml" is not set correctly
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<!-- The juddi service configration -->
<!-- Whether we want to run the db initialization scripts -->
<!-- Should all tables be created on Start-->
false
<!-- Should all tables be dropped on Stop-->
true
<!-- Should all tables be dropped on Start-->
false
<!-- Datasource to Database-->
java:/DefaultDS
<!-- Alias to the registry-->
RegistryOperator
<!-- Should I bind a Context to which JaxrConnectionFactory bound-->
true
<!-- Context to which JaxrConnectionFactory to bind to.
If you have remote clients, please bind it to the global
namespace(default behavior). To just cater to clients running
on the same VM as JBoss, change to java:/JAXR -->
java:/JAXR
false
jboss.jca:service=DataSourceBinding,name=DefaultDS
If you have both the web service consumer and producer in the same VM
BindJaxr should be
java:/JAXR
If web service consumer and producer are in different VM
BindJaxr should be
JAXR
If BindJaxr is not set properly as per the above condition JNDI bind for JAXR would fail
thanks,
Nirmala
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095838#4095838
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095838
17 years
[JBossWS] - Results: jboss-4.0.4 AS and jbossws-2.0.1 Integration
by ptenn10
Hi All,
Well, thanks to help from Richard's posts, I was able to get jboss-4.0.4 AS working with jbossws-2.0.1.
I was still getting an error:
anonymous wrote :
| java.lang.NoSuchMethodError: javax.xml.bind.JAXBContext.newInstance([Ljava/lang/Class;)Ljavax/xml/bind/JAXBContext;
However, I tracked this down to the fact that jboss-4.0.4 AS ships with JAXB 1.x (not sure exact version, but I checked method signatures and know it is prior to JAXB 2), and jboss-ws 2.0.1 requires JAXB 2.
A JIRA entry by Thomas also confirms this:
http://jira.jboss.com/jira/browse/JBWS-947
If I do as Thomas suggested and drop in the jaxb-api.jar into the endorsed directory, it works. I did verify this, as a test.
However, this is not a viable solution for us, nor is modifying the contents of the jboss-j2ee.jar and jbossall-client.jar. So basically I've reached a dead-end in terms of jboss-4.0.4 and jbossws-2.0.1 integration.
Hopefully this information will be useful for someone who is trying to run jboss-4.0.4 AS with jbossws-2.0.1 and is able to make one of the two fixes described in http://jira.jboss.com/jira/browse/JBWS-947
As for me ... I'll have to look toward going to jboss-4.2.x AS and hopefully there won't be a JAXB conflict there, or look into another Web Services implementation.
Thanks,
Philip Tenn
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095749#4095749
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095749
17 years
[JBossWS] - SessionBean as WebService - again complex data structures
by CarstenRudat
Hi all,
I have a SLSB and want it to be accessable through a webservice. So I write
| package com.genloop.ejb.beans.service;
|
| import javax.ejb.Remote;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| @WebService
| @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
| @Remote
| public interface PartnerWebService extends java.rmi.Remote{
|
| @WebMethod
| public String sayHello(String hello);
|
| }
|
and
| package com.genloop.ejb.beans.service;
|
| import java.util.Date;
|
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
| import javax.interceptor.Interceptors;
| import javax.jws.WebService;
|
| import org.jboss.annotation.ejb.RemoteBinding;
| import org.jboss.annotation.security.SecurityDomain;
|
| import com.genloop.ejb.commons.SecurityInterceptor;
| import com.genloop.ejb.commons.UserInterceptor;
|
| @Stateless
| @Remote(PartnerWebService.class)
| @SecurityDomain("...")
| @org.jboss.annotation.ejb.Clustered
| @RemoteBinding(jndiBinding="test/PartnerWebService/remote")
| @Interceptors({UserInterceptor.class, SecurityInterceptor.class})
| @WebService(endpointInterface="com.genloop.ejb.beans.service.PartnerWebService", serviceName="PartnerService")
| public class PartnerWebServiceBean implements PartnerWebService {
|
| public String sayHello(String hello) {
| return hello;
| }
|
| }
|
My Client works well:
| public class PartnerWSClient {
|
| public static void main(String[] args) {
| try {
| URL url = new URL("http://localhost:8080/test-ea-test-service/PartnerWebServiceBean?wsdl");
| QName qname = new QName("http://service.beans.ejb.genloop.com/", "PartnerService");
|
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(url, qname);
|
| PartnerWebService partnerService = (PartnerWebService)service.getPort(PartnerWebService.class);
|
| System.out.println(partnerService.sayHello("test"));
| } catch (MalformedURLException e) {
| e.printStackTrace();
| } catch (ServiceException e) {
| e.printStackTrace();
| }
| }
| }
|
But now, I add another mehtod:
| public ComplexObject getComplexObject() {
| return new ComplexObject(new Date(), "test");
| }
|
| ...
|
| @WebMethod
| public ComplexObject getComplexObject();
|
| ...
|
| public class ComplexObject implements Serializable {
|
| protected Date date;
|
| protected String string;
|
| public ComplexObject() {
| }
|
| getter/setter
| }
|
No, I just get this exception:
| Cannot obtain java/xml type mapping for: {http://service.beans.ejb.genloop.com/}complexObject
|
I use JBoss 4.2.1 and updated JBoss Web Services to version 2.0.
And my question is: What am I doing wrong? Is there any way to get user datastructures work?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095598#4095598
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095598
17 years
[JBossWS] - Cannot obtain wsdl service (problem in JBoss 4.2 used to wor
by burakbayramli
I have the following code that used to work in JBoss 4.0.4GA. After port to 4.2, server complained about "context roots being different, so I added @WebContext to all web services. Now server is fine, I can see the WSDL, but I cannot connect to the server using a Java client.
| @WebService
| @SOAPBinding(style=Style.RPC)
| public interface Calculator extends Remote
| {
| @WebMethod int add(int x, int y);
|
| @WebMethod int subtract(int x, int y);
| }
|
| @Stateless
| @WebService(name="CalculatorService",serviceName="CalculatorService",endpointInterface="org.bilgidata.kitapdemo.service.Calculator")
| @WebContext(contextRoot="/ggServices")
| public class CalculatorBean implements Calculator
| {
| public int add(int x, int y)
| {
| System.out.println("inside add");
| return x + y;
| }
|
| public int subtract(int x, int y)
| {
| System.out.println("inside subtract");
| return x - y;
| }
| }
|
| public class Client
| {
| public static void main(String[] args) throws Exception
| {
| URL url = new URL("http://localhost:8080/ggServices/CalculatorBean?wsdl");
| QName qname = new QName("http://localhost:8080/ggServices/CalculatorBean",
| "CalculatorService");
|
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(url, qname);
|
| Calculator calculator = (Calculator) service.getPort(Calculator.class);
|
| System.out.println("1 + 1 = " + calculator.add(1, 1));
| System.out.println("1 - 1 = " + calculator.subtract(1, 1));
| }
| }
|
The WSDL looks like
| <definitions name='CalculatorService' targetNamespace='http://service.kitapdemo.bilgidata.org/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://service.kitapdemo.bilgidata.org/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types></types>
| <message name='Calculator_subtract'>
| <part name='arg0' type='xsd:int'></part>
| <part name='arg1' type='xsd:int'></part>
| </message>
| <message name='Calculator_add'>
| <part name='arg0' type='xsd:int'></part>
| <part name='arg1' type='xsd:int'></part>
| </message>
| <message name='Calculator_addResponse'>
| <part name='return' type='xsd:int'></part>
| </message>
| <message name='Calculator_subtractResponse'>
| <part name='return' type='xsd:int'></part>
| </message>
| <portType name='Calculator'>
| <operation name='add' parameterOrder='arg0 arg1'>
| <input message='tns:Calculator_add'></input>
| <output message='tns:Calculator_addResponse'></output>
| </operation>
| <operation name='subtract' parameterOrder='arg0 arg1'>
| <input message='tns:Calculator_subtract'></input>
| <output message='tns:Calculator_subtractResponse'></output>
| </operation>
| </portType>
| <binding name='CalculatorBinding' type='tns:Calculator'>
| <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='add'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body namespace='http://service.kitapdemo.bilgidata.org/' use='literal'/>
| </input>
| <output>
| <soap:body namespace='http://service.kitapdemo.bilgidata.org/' use='literal'/>
| </output>
| </operation>
| <operation name='subtract'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body namespace='http://service.kitapdemo.bilgidata.org/' use='literal'/>
| </input>
| <output>
| <soap:body namespace='http://service.kitapdemo.bilgidata.org/' use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='CalculatorService'>
| <port binding='tns:CalculatorBinding' name='CalculatorServicePort'>
| <soap:address location='http://127.0.0.1:8080/ggServices/CalculatorBean'/>
| </port>
| </service>
| </definitions>
|
| Exception in thread "main" java.lang.IllegalArgumentException: Cannot obtain wsdl service: {http://localhost:8080/ggServices/CalculatorBean}CalculatorService
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaDataInternal(JAXRPCClientMetaDataBuilder.java:171)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:133)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:85)
| at org.jboss.ws.core.jaxrpc.client.ServiceImpl.<init>(ServiceImpl.java:111)
| at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
| at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
| at org.bilgidata.kitapdemo.service.Client.main(Client.java:18)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095525#4095525
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095525
17 years