File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Web Services
Bookmark "cannot access stub" Watch "cannot access stub" New topic
Author

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.
--------------------
HoroscopeClient.java:14: 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
2. HoroscopeImplementation.java
3. HoroscopeInterface.java
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
3. HoroscopeClient.java

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
Rgds
Sree


Sree
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42641
    
  65
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
Rgds
Sree
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)
 
 
subject: cannot access stub