Mayank S
asked on
Eclipse compiler
Hi all,
I'm facing a strange problem with Eclipse version 3.1.2 (pointing to JRE of JDK 5.0 update 6). I used WSDL 2 Java to create stubs for a web-service. When I add the stubs to my project, after adding a reference to axis.jar (1.3), I get compilation errors in the places where the auto-generated stub uses anything defined in the org.apache.axis.enum package because it starts recognizing 'enum' as a keyword, not as a part of a package-name.
Anybody ever faced this before? Any settings in the Window -> Preferences -> Java -> Compiler or in Project -> Properties -> Java Compiler can fix it?
Thanks,
Mayank.
I'm facing a strange problem with Eclipse version 3.1.2 (pointing to JRE of JDK 5.0 update 6). I used WSDL 2 Java to create stubs for a web-service. When I add the stubs to my project, after adding a reference to axis.jar (1.3), I get compilation errors in the places where the auto-generated stub uses anything defined in the org.apache.axis.enum package because it starts recognizing 'enum' as a keyword, not as a part of a package-name.
Anybody ever faced this before? Any settings in the Window -> Preferences -> Java -> Compiler or in Project -> Properties -> Java Compiler can fix it?
Thanks,
Mayank.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Actually, kawas almost has it. Set the compiler to generate 1.4 compatible code, and compile for 1.4. Are you absolutely sure that you're using axis 1.3?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes I downloaded 1.3 latest version from the Axis web site. I am using many Java 5 classes in the project and its a big application so you think it makes sense to set the compiler to 1.4 compatibility?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Guess what? It does not give this problem on another system which has the same Java version and same Eclipse and same Axis version as mine (another guy in my team who installed all this from the same downloads which I had made).
I checked the project-specific compiler settings on both machines and every setting is the same $#$!@#%!$@%^$!@^%$!@%!^@&% ^!@&%^!&@^ &!@^!
I checked the project-specific compiler settings on both machines and every setting is the same $#$!@#%!$@%^$!@^%$!@%!^@&%
Hi mayankeagle,
have you tried to reinstall all (in the same order as on the machine where it works) ?
have you tried to reinstall all (in the same order as on the machine where it works) ?
ASKER
Yes, that is what we'd done on both machines.... uninstalled all older versions of Java, install JDK 5.0 update 6 and then copy Eclipse 3.1.2.
In your source code you have to replace package
org.apache.axis.enum
by
org.apache.axis.constants
org.apache.axis.enum
by
org.apache.axis.constants
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As a matter of fact, that is what I observed. It uses Style and Use which are defined in enum. When I changed them to org.apache.axis.constants, the errors were (obviously) gone. I was about to ask that whether this will mean any change in functionality or not, and you just confirmed that there will not be any problems, so I'll accept that as an answer.
ASKER
However, perhaps this is a bug in WSDL2Java that the generated the stub contains calls to org.apache.axis.enum and not constants :)
nice to know how to fix this.
ASKER
fargo, I just noticed that on the link you posted, somewhere it says that WSDL 2 Java will generate stubs containing constants instead of enum in the package-name. Though it didn't happen in my case (wonder why), I guess you deserve some points for this too. Hang on, I'll ask Venabili to re-open this.
it's ok mayank. I think others help was better than mine.
ASKER
No, I think you deserved some points for this too, now don't make me change my mind :)
I also think fargo deserved some points.
>> No, I think you deserved some points for this too, now don't make me change my mind :)
Don't dare do this...otherwiseeeee
Leute, thanks for your kindness. But don't do this.
Don't dare do this...otherwiseeeee
Leute, thanks for your kindness. But don't do this.
Hey...
>> In your source code you have to replace package
>> org.apache.axis.enum
>> by
>> org.apache.axis.constants
got credit. And what is that...wait for it...REFACTORING...which I believe I mentioned in one of my posts @ 11.34 p.m....tsk tsk...
:-)
>> In your source code you have to replace package
>> org.apache.axis.enum
>> by
>> org.apache.axis.constants
got credit. And what is that...wait for it...REFACTORING...which I believe I mentioned in one of my posts @ 11.34 p.m....tsk tsk...
:-)
ASKER
Hang on till the Q opens :)
ASKER