We help IT Professionals succeed at work.
Get Started

How do I resolve this error "javax.xml.ws.WebServiceException .... Place the resource correctly in the classpath.?

Last Modified: 2018-01-04

My experience is that I'm a seasoned programmer in other languages, however  in Java I've only done basic batch file processing and have never used it in anger for Web Developing.

I'm developing a Java Desktop App which contains Web Services clients that consumes/interacts with an API provided by www.betfair.com.  I'm following a tutorial that is mentioned on that website, the tutorial links are in the order that I have followed:

1) https://web.archive.org/web/20091226122643/http://forum.bdp.betfair.com/blog.php?b=4 ( Getting started )
2) https://web.archive.org/web/20091226122414/http://forum.bdp.betfair.com/blog.php?b=6 ( Logging into Betfair using NetBeans part A)
3) https://web.archive.org/web/20091226122538/http://forum.bdp.betfair.com/blog.php?b=7 ( Logging into Betfair using NetBeans part B)
4) https://web.archive.org/web/20120319162850/http://forum.bdp.betfair.com:80/blog.php?b=8 ( Logging into Betfair using NetBeans part C)

I downloaded the latest NetBeans 6.8 ( The full and complete NetBeans package) and followed the instructions provided in the tutorals:

1) to create the Web Service clients using the WDSL urls

When creating the Web clients as part of the Getting Started tutorial, I got an error in the automated generation part, which required me to use the "xendorsed="true" to get that part to compile. As far as I know, this part is okay, but maybe related to the error which is tthe basis for me writing this question.

and 2)create a basic Login GUI.

When I try to run the basic GUI login screen I've created using the tutorials, I get the following error message:

javax.xml.ws.WebServiceException: Cannot find 'https://api.betfair.com/global/v3/BFGlobalService.wsdl' wsdl. Place the resource correctly in the classpath.
at com.betfair.publicapi.v3.bfglobalservice.BFGlobalS ervice_Service.<clinit>(BFGlobalService_Service.ja va:32)
at me.wsop.betfair.exchange.bfLogin.doLogin(bfLogin.j ava:35)
at me.wsop.betfair.exchange.bfLogin.<init>(bfLogin.ja va:24)
at betfair.BetfairView.btnLoginActionPerformed(Betfai rView.java:272)

Open in new window

and the automated Java code that provides this error is:

* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2-hudson-752-
* Generated source version: 2.2
@WebServiceClient(name = "BFGlobalService", targetNamespace = "http://www.betfair.com/publicapi/v3/BFGlobalService/", wsdlLocation = "https://api.betfair.com/global/v3/BFGlobalService.wsdl")
public class BFGlobalService_Service
extends Service

private final static WebServiceException BFGLOBALSERVICE_EXCEPTION;
private final static QName BFGLOBALSERVICE_QNAME = new QName("http://www.betfair.com/publicapi/v3/BFGlobalService/", "BFGlobalService");

static {
BFGLOBALSERVICE_WSDL_LOCATION = com.betfair.publicapi.v3.bfglobalservice.BFGlobalS ervice_Service.class.getResource("https://api.betfair.com/global/v3/BFGlobalService.wsdl");
WebServiceException e = null;
e = new WebServiceException("Cannot find 'https://api.betfair.com/global/v3/BFGlobalService.wsdl' wsdl. Place the resource correctly in the classpath.");

Open in new window

I've read other forums for an answer for my situation and now I'm confused as to what the actual solution is, whether I need to amend Java code, roll back to an early version of Jar files, add Environmental Variables to the OS system paths or whether to install missing Jar files in certain locations.

It seems to be a common problem, but I'm at a loss on how to resolve it.  So I'm in your capable hands for the solution to my problem.

So for those who reply, let me know what extra information you may require and I'll provide it the best I can.

Thank you in advance.
Watch Question
Principal Solutions Architect
Top Expert 2006
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE