Compile error when generating webservice proxies with JDeveloper 10.1.3

For a web-application I once created a web service proxy to communicate with a web service. In this same application we also communicated with BPEL by using the HumanWorkflow API. Why this is important to know I will explain later.

Creating the proxy was a really simple thing to do with JDeveloper 10.1.3. Just run the wizard and select the corresponding WSDL and voila. I had done this many times with JDev 10.1.2. but this time the generated webservice proxy gave compile errors! And I had done nothing exotic whatsoever!

The error was in the constructor of the class ‘MyWebService1SoapHttpPortClient’:

public MyWebService1SoapHttpPortClient() throws Exception
{
  ServiceFactory factory = ServiceFactory.newInstance();
  _port =
 ((test.ws.MyWebService1_Service)factory.loadService(test.ws.MyWebService1_Service.class)).getMyWebService1SoapHttpPort();
}

Of course I didn’t give the service really that name. This is just an example.

The error said:
Error(22,57): method loadService(java.lang.Class) not found in class javax.xml.rpc.ServiceFactory

After some extensive search I found out the error was caused by the loaded libraries in the project. Apparently the library needed for communication with the BPEL Workflow API ‘BPM Workflow’ loaded some old classes that were interfering with the generated proxy classes. The issue was solved by moving the ‘BPM Workflow’ library downwards, so it is loaded after the ‘ JAX-RPC Client’.

loaded libraries

By doing this the generated proxy compiled (and worked) fine.

Later on the development of the web-application I decided to split the functionality in different project so this issue wasn’t a problem anymore, but if you are running into the same issue maybe this post will help you.

About Pascal Alma

Pascal is a senior IT consultant and has been working in IT since 1997. He is monitoring the latest development in new technologies (Mobile, Cloud, Big Data) closely and particularly interested in Java open source tool stacks, cloud related technologies like AWS and mobile development like building iOS apps with Swift. Specialties: Java/JEE/Spring Amazon AWS API/REST Big Data Continuous Delivery Swift/iOS
This entry was posted in BPEL, Web Service and tagged , . Bookmark the permalink.

7 Responses to Compile error when generating webservice proxies with JDeveloper 10.1.3

  1. Dam says:

    Hi Pascal , nice article ..! One question ..
    Did you try to create a web service proxy (client) using xFire clients or another open source implementation ?

  2. Pascal Alma says:

    Hi,
    At this project I only used the ‘built-in’ wizard of JDeveloper to create the service proxy. In other projects at which JDeveloper wasn’t used I started to use XFire.

  3. Pascal Alma says:

    Hi,
    At this project I only used the ‘built-in’ wizard of JDeveloper to create the service proxy. In other projects at which JDeveloper wasn’t used I started to use XFire.

  4. Mauricio Lopez says:

    Thanks for the post! veru useful. U save me some time. .-)

  5. Harinath says:

    Thanks a lot, i was breaking my head to resolve this

  6. Patrick says:

    Had the same exact problem, this worked perfectly. Thanks!

  7. khad01 says:

    I have the same problem, but not get resolved even i did what you mentioned. I their any help…PLEAAASe i’m breaking my heart

Comments are closed.