1 Reply Latest reply on Jun 9, 2007 5:21 PM by tph1

    ex19_1: WSException: Cannot obtain java type mapping

    tph1

      $ echo $JBOSS_HOME
      C:\jboss-4.2.0.GA
      $ echo $JAVA_HOME
      C:\Programs\Java\jdk1.5.0_12

      The client in example 19_1 fails. I am running JBoss 4.2. Am I doing something wrong? Is the example obsolete in someway?
      I would appreciate a way to resolve this.
      Thanks, -Tim

      I ran into 2 types of errors while attempting to run example 19 out of oreilly-ejb3-workbook_for_jboss404_GA.zip.

      At first, 'ant run.client' complains:
      [java] javax.naming.NamingException: Could not dereference object [Root exception is org.jboss.ws.metadata.wsdl.WSDLException: Cannot parse wsdlLocation: http://localhost:8080/titan/TravelAgentBean?wsdl]

      I worked around this by editing both of these configuration files to make the WSDL settings match what was really deployed ("http://localhost:8080/TravelAgentBeanService/TravelAgentBean"):

      But now, I am stymied by an error that the client hits:

      run.client:
      [java] javax.naming.NamingException: Could not dereference object [Root exception is org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://travelagent.titan.com/}createCabin]
      [java] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1150)
      [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
      [java] at org.jboss.naming.client.java.javaURLContextFactory$EncContextProxy.invoke(javaURLContextFactory.java:135)
      [java] at $Proxy0.lookup(Unknown Source)
      [java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      [java] at com.titan.clients.Client.main(Client.java:14)
      [java] Caused by: org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://travelagent.titan.com/}createCabin
      [java] at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.processDocElement(JAXRPCMetaDataBuilder.java:627)
      [java] at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildParameterMetaDataDoc(JAXRPCMetaDataBuilder.java:886)
      [java] at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.setupOperationsFromWSDL(JAXRPCMetaDataBuilder.java:214)
      [java] at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaDataInternal(JAXRPCClientMetaDataBuilder.java:216)
      [java] at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:133)
      [java] at org.jboss.ws.core.jaxrpc.client.ServiceImpl.(ServiceImpl.java:126)
      [java] at org.jboss.ws.core.jaxrpc.client.ServiceObjectFactory.getObjectInstance(ServiceObjectFactory.java:141)
      [java] at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
      [java] at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
      [java] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
      [java] ... 5 more


      Here are some lines from the log that occur during deployment:

      :
      16:34:26,050 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:jar=titan.jar,unitName=titan
      16:34:26,081 INFO [Ejb3Configuration] found EJB3 Entity bean: com.titan.domain.Cabin
      16:34:26,081 WARN [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
      16:34:26,081 INFO [Configuration] Reading mappings from resource : META-INF/orm.xml
      16:34:26,081 INFO [Ejb3Configuration] [PersistenceUnit: titan] no META-INF/orm.xml found
      16:34:26,081 INFO [AnnotationBinder] Binding entity from annotated class: com.titan.domain.Cabin
      :
      16:34:26,206 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=titan.jar,name=TravelAgentBean,service=EJB3 with dependencies:
      16:34:26,206 INFO [JmxKernelAbstraction] persistence.units:jar=titan.jar,unitName=titan
      16:34:26,253 INFO [EJBContainer] STARTED EJB: com.titan.travelagent.TravelAgentBean ejbName: TravelAgentBean
      16:34:26,316 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.2.0.GA/server/default/deploy/titan.jar
      16:34:26,331 INFO [WSDLFilePublisher] WSDL published to: file:/C:/jboss-4.2.0.GA/server/default/data/wsdl/titan.jar/TravelAgentService58108.wsdl
      16:34:26,394 INFO [ServiceEndpointManager] WebService started: http://localhost:8080/TravelAgentBeanService/TravelAgentBean

        • 1. Re: ex19_1: WSException: Cannot obtain java type mapping
          tph1

          I figured out how to modify the client resources (src/resources/client/META-INF/*.xml) to enable the run.client target to run successully.
          Ex19_1 works fine with jboss4.0.4.GA (as specifically promised).

          When using jboss4.0.5.GA, the annotated web service bean fails to deploy:
          21:46:44,187 ERROR [MainDeployer] Could not create deployment: file:/F:/Programs/Java/jboss-4.0.5.GA/server/default/deploy/titan.jar
          java.lang.NullPointerException
          at java.lang.Class.isAssignableFrom(Native Method)
          at org.jboss.ws.tools.helpers.JavaToWSDLHelper.generateType(JavaToWSDLHelper.java:559)

          Starting with jboss4.2.0.GA, there are two changes in the way that the annotated WebService bean is deployed.
          1. The annotated Web Service bean is deployed to a different place. The client's config.xml and jboss-client.xml need to be updated to point to the WSDL at:
          http://localhost:8080/TravelAgentBeanService/TravelAgentBean?wsdl
          2. The namespace no longer contains "/jaws". The deployed WSDL now specifies:
          targetNamespace="http://travelagent.titan.com/"
          Every use of the namespace had to be modified in the client's jaxrpc-mapping.xml.

          Can someone please post a short explanation about why these changes were made in JBossWS?

          Does anyone have an idea about why the TravelAgentService fails to deploy on jboss4.0.5? I upgraded that installation with JBossWS 1.0.4.

          Thanks,
          -Tim