Two Laptop Bag*
The moose likes Web Services and the fly likes cannot access stub Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "cannot access stub" Watch "cannot access stub" New topic

cannot access stub

Sree kanth
Ranch Hand

Joined: Feb 02, 2005
Posts: 53
Hi all
I created a webservice which i could successfully deploy. but when i tried to compile my client it is showing an error as follows.
-------------------- cannot access staticstub.HoroscopeInterface
bad class file: .\build\staticstub\HoroscopeInterface.class
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
HoroscopeInterface hface=(HoroscopeInterface)stub;
1 error
following are the pakages involved in my webservice

I have a directory named HoroscopeWS which contatins the following

1. config.xml
4. HoroscopeWebServiceWar.war
5. build (A directory)

build directory contains the following

1. HoroscopeWebService.wsdl
2. mapping.xml
3. horoscope(A package)

horoscope contains the following

1. HoroscopeImplementation.class
2. HoroscopeInterface.class

Following are the packages involved in the client application

I have a directory named static-stub which contatins the following

1. build(A directory)
2. config-wsdl.xml

Build contains

1. staticstub (A package)

staticstub contains
1. HoroscopeInterface.class
2. HoroscopeInterface_getSunSignTrait_RequestStruct.class
3. HoroscopeInterface_getSunSignTrait_RequestStruct_SOAPSerializer.class
4. HoroscopeInterface_getSunSignTrait_ResponseStruct.class
5. HoroscopeInterface_getSunSignTrait_ResponseStruct_SOAPBuilder.class
6. HoroscopeInterface_getSunSignTrait_ResponseStruct_SOAPSerializer.class
7. HoroscopeInterface_Stub.class
8. HoroscopeWebService.class
9. HoroscopeWebService_Impl.class
10. HoroscopeWebService_SerializerRegistry.class

What might be the reason for the error

Thanks in advance

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41064
Did you use Java 5 to compile that class, and are now using Java 1.4 to run it? I think class file version 49 is the one used by Java 5, while 48 is the one Java 1.4 uses.

Ping & DNS - my free Android networking tools app
Sree kanth
Ranch Hand

Joined: Feb 02, 2005
Posts: 53
No. i am using java 1.4 only for everything
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
Then maybe you used compiler options for different language versions (i.e. same javac, but emitted code for 1.3 and 1.4, or 1.4 and 1.5). That message always means the class files aren't for a language version the JVM was expecting to see.

Reid - SCJP2 (April 2002)
wood burning stoves
subject: cannot access stub
Similar Threads
Sun webservices tutorial
Error while deploying the war file using command "asant deploy"
Issue while deploying web service jwstutorial example CLI171
RMI Architecture Problems
Question: using classpath with javac command