Forum Stats

  • 3,727,516 Users
  • 2,245,399 Discussions
  • 7,852,844 Comments

Discussions

Getting error in Taleo web service call in Java web application

Deepak_Gupta22
Deepak_Gupta22 Member Posts: 6

Hi All,

Eclipse: Luna 4.4.2

Tomcate 8.0

Attaching my POM.xml

I want to call taleo webservice and trying to create a dynamic web application.

I tried following scenarios:

Scenarion 1:

Step 1:

(First created dynamic web application then convert it to a maven project). As soon as i added wsdl to this project getting below error in wsdl:

src-resolve.4.2: Error resolving component 'ns2:Entity'. It was detected that 'ns2:Entity' is in namespace 'http://www.taleo.com/

ws/tee800/2009/01', but components from this namespace are not referenceable from schema document 'file:///C:/Users/

deepak_gupta22/WorkSpace1/test123/src/taleoWebservice.wsdl'. If this is the incorrect namespace, perhaps the prefix of

'ns2:Entity' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:///C:/

Users/deepak_gupta22/WorkSpace1/test123/src/taleoWebservice.wsdl'.

Step 2:

Ignore this error in wsdl and build the application and wrote the client code and run the application. I got below error (XmlObject class is exist in project. attached a pic for its path):

SEVERE: Servlet.service() for servlet [main.MyTestServlet] in context with path [/test123] threw exception [Servlet execution threw an exception] with root cause

java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:763)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2496)

at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:860)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1302)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)

at java.lang.Class.privateGetPublicMethods(Class.java:2902)

at java.lang.Class.getMethods(Class.java:1615)

at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:462)

at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:305)

at com.sun.xml.internal.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:85)

at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:59)

at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:43)

at com.sun.xml.internal.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:105)

at com.sun.xml.internal.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:875)

at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:892)

at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:855)

at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:435)

at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:404)

at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:386)

at javax.xml.ws.Service.getPort(Service.java:119)

at com.taleo.ws.tee800._2009._01.find.FindService.getFindServiceHttpPort(FindService.java:72)

at main.ClientService.getEntities(ClientService.java:202)

at main.MyTestServlet.doGet(MyTestServlet.java:42)

Scenario 2:

Step 1: Created a maven project, add the wsdl into it and generate source for wsdl. Then trying to convert it into web application Getting below error:

cannot nest '31JanTest/target/generated-sources/cxf/schemaorg_apache_xmlbeans' inside '31JanTest/target/generated-sources/cxf'.

To enable the nesting exclude 'schemaorg_apache_xmlbeans/' from '31JanTest/target/generated-sources/cxf'.

Scenario 3:

Created a maven project and generate the source for wsdl and write the code for client.Able to call the webservice without any error And create java UI (Frame) and show the result on UI.

Scenario 4: wsdl is working fine in SOAP UI also.

What am I missing in web application or what i have to add in web application to work it properly?

Experts please help me to resolve the issue.

Pleaase let me know if more information needed from my side.

Thanks and Regards,

Deepak

Answers

  • Deepak_Gupta22
    Deepak_Gupta22 Member Posts: 6
    edited February 2018

    I can see in java project below two folders are created automatically:

    1. target/generated-sources/cxf

    2. target/generated-sources/cxf/schemaorg_apache_xmlbeans

    But in web project only one folder is created:

    1. target/generated-sources/cxf

    target/generated-sources/cxf/schemaorg_apache_xmlbeans forlder is not created in web project. Please help me what is wrong in my project?

    pastedImage_1.png

  • Deepak_Gupta22
    Deepak_Gupta22 Member Posts: 6
    edited February 2018

    In the marker tab. i was getting "Classpath entry org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result" warning.

    I Resolved it by doing following steps: 1. Right click on this warning and click on quick fix option 2. Select Mark the associated raw classpath entry as a publish/export dependency. And click on finish

    Deepak_Gupta22
This discussion has been closed.