JBoss Community

Soap over JMS using JBOSS - Error: scheme java not recognized

created by ale2011 in JNDI and Naming - View the full discussion

Hello,

 

I'm a newbie with web services and Jboss. I am trying to develop a simple Soap over JMS weather service with Jboss.

- I integrated activeMQ with Jboss (link)

- Implemented the server and deployed it

- Generate the client codes , and my main class is as below (I followed this tutorial)

 

public static void main(String args[]) throws Exception {
        URL wsdlURL = new URL("file:/C:/jboss/jboss.6.0.0.Final/server/default/data/wsdl/SoapOverJms_JmsOnly.war/soapjmsweatherimpl.wsdl");
        System.out.println(wsdlURL);
        
        if (args.length > 0)  { 
            File wsdlFile = new File(args[0]);
            try {
                if (wsdlFile.exists()) {
                    wsdlURL = wsdlFile.toURI().toURL();
                } else {
                    wsdlURL = new URL(args[0]);
                }
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
        }
      
        SoapJmsWeatherImpl ss = new SoapJmsWeatherImpl(wsdlURL, SERVICE_NAME);
        Bus bus = BusFactory.newInstance().createBus();
        BusFactory.setThreadDefaultBus(bus);
 
        try {
            SoapJmsWeatherImplPort proxy = (SoapJmsWeatherImplPort) ss.getPort(new QName("http://soapoverjms.nsrr.swim.faa.gov/", "SoapJmsWeatherImplPort"), SoapJmsWeatherImplPort.class);
 
            System.out.println("\nInvoking getForecast...");
            proxy.getForecast("Philadelphia");
        }
        finally
        {
            bus.shutdown(true);
        }
        System.exit(0);
    }

 

After I execute the client, I got this error:

 

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: javax.naming.NamingException: scheme java not recognized
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
    at $Proxy31.getForecast(Unknown Source)
    at gov.faa.swim.nsrr.soapoverjms.MainClient.main(MainClient.java:59)
Caused by: java.lang.RuntimeException: javax.naming.NamingException: scheme java not recognized
    at org.apache.cxf.transport.jms.JMSFactory.getConnectionFactoryFromJndi(JMSFactory.java:87)
    at org.apache.cxf.transport.jms.JMSConfiguration.getOrCreateWrappedConnectionFactory(JMSConfiguration.java:433)
    at org.apache.cxf.transport.jms.JMSConfiguration.ensureProperlyConfigured(JMSConfiguration.java:104)
    at org.apache.cxf.transport.jms.JMSConduit.prepare(JMSConduit.java:101)
    at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
    ... 2 more
Caused by: javax.naming.NamingException: scheme java not recognized
    at org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:221)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
    at org.apache.cxf.transport.jms.JMSFactory.getConnectionFactoryFromJndi(JMSFactory.java:75)
    ... 12 more

 

I could post more codes if neccessary.

Could anyone explain why this exception was thrown? Any ideas/help would be appreciate.

Reply to this message by going to Community

Start a new discussion in JNDI and Naming at Community