1 Reply Latest reply on Jun 3, 2011 12:08 AM by leon z

    ejb web service client example failed - IOEXCEPTION vfs protocal

    leon z Newbie

      This is the web service client example on ejb 3.0 book. The web service has been installed. this is the error message

       

      jboss 6.0.0-final jdk 6.0

       

      run.client:

           [java] javax.naming.NamingException: Cannot unmarshall service ref meta data [Root exception is java.io.IOException: unknown protocol: vfs]

           [java]     at org.jboss.ws.core.jaxrpc.client.ServiceObjectFactoryJAXRPC.getObjectInstance(ServiceObjectFactoryJAXRPC.java:120)

           [java]     at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)

           [java]     at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1483)

           [java]     at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1500)

           [java]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:824)

           [java]     at org.jboss.naming.client.java.javaURLContextFactory$EncContextProxy.invoke(javaURLContextFactory.java:153)

           [java]     at $Proxy0.lookup(Unknown Source)

           [java]     at javax.naming.InitialContext.lookup(InitialContext.java:392)

           [java]     at com.titan.clients.Client.main(Client.java:14)

           [java] Caused by: java.io.IOException: unknown protocol: vfs

           [java]     at java.net.URL.readObject(URL.java:1220)

           [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:597)

           [java]     at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)

           [java]     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)

           [java]     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)

           [java]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)

           [java]     at java.io.ObjectInputStream.access$300(ObjectInputStream.java:187)

           [java]     at java.io.ObjectInputStream$GetFieldImpl.readFields(ObjectInputStream.java:2108)

           [java]     at java.io.ObjectInputStream.readFields(ObjectInputStream.java:518)

           [java]     at org.jboss.metadata.serviceref.VirtualFileAdaptor.readObject(VirtualFileAdaptor.java:217)

           [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:597)

           [java]     at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)

           [java]     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)

           [java]     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)

           [java]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)

           [java]     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)

           [java]     at org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData.readObject(UnifiedServiceRefMetaData.java:477)

           [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:597)

           [java]     at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)

           [java]     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)

           [java]     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)

           [java]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)

           [java]     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)

           [java]     at org.jboss.ws.core.jaxrpc.client.ServiceObjectFactoryJAXRPC.getObjectInstance(ServiceObjectFactoryJAXRPC.java:115)

           [java]     ... 8 more

       

       

       

      import javax.naming.Context;

      import javax.naming.NamingException;

       

      public class Client

      {

          public static void main(String [] args)

          {

              try

              {

                  Context jndiContext = getInitialContext();

                  TravelAgentService service =

                     (TravelAgentService) jndiContext.lookup("java:comp/env/service/TravelAgentService");

                  TravelAgent agent = service.getTravelAgentPort();

       

                  Cabin cabin_1 = new Cabin();

                  cabin_1.setId(1);

                  cabin_1.setName("Master Suite");

                  cabin_1.setDeckLevel(1);

                  cabin_1.setShipId(1);

                  cabin_1.setBedCount(3);

       

                  agent.createCabin(cabin_1);

       

                  Cabin cabin_2 = agent.findCabin(1);

                  System.out.println(cabin_2.getName());

                  System.out.println(cabin_2.getDeckLevel());

                  System.out.println(cabin_2.getShipId());

                  System.out.println(cabin_2.getBedCount());

       

              }

              catch (javax.naming.NamingException ne)

              {

                  ne.printStackTrace();

              }

              catch (java.rmi.RemoteException re)

              {

                  re.printStackTrace();

              }

              catch (javax.xml.rpc.ServiceException se)

              {

                  se.printStackTrace();

              }

          }

       

          public static Context getInitialContext()

              throws javax.naming.NamingException

          {

              return new javax.naming.InitialContext();

          }

      }

       

       

      trying to install JBOSSWS in addition to JBOSS - still cannot fix the issue.

      Thank you very much.