Axis 1.2.1 , JDK 1.5.0_07 Unecked or unsafe operations.

S

sakcee

I am trying to compile the client side stubs generaed from
a WSDL.


When I build the examples I get the following warning message

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.


with -Xlint:unchecked
it gives lots of warnings

warning: [unchecked] unchecked call to put(K,V) as a member othe raw
type java.util.HashMap
_table_.put(_value_,this);


warning: [unchecked] unchecked call to add(E) as a member of the ra
type java.util.Vector
cachedSerQNames.add(qName);




Is it due to the generics introduced in jdk 1.5
Is it due to some compatibility between axis 1.2.1 and jdk 1.5?
can I fix it without switching to some other verison of axis?

this aplication is using jdk 1.5 and is not deployed in any container
just a command line
application


How can I fix it?

Thanks for help
 
L

Lew

I am trying to compile the client side stubs generaed from
a WSDL.


When I build the examples I get the following warning message

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details. ....
Is it due to the generics introduced in jdk 1.5

Yes. You have "raw types" (GIYF) when you don't use generic decorations, and
the use of raw types causes this warning.
Is it due to some compatibility between axis 1.2.1 and jdk 1.5?
No.

can I fix it without switching to some other verison of axis?

Yes. Either annotate the relevant code with '@SuppressWarnings( "unchecked")'
or rewrite your code to use generic decorations.

If you ignore the warnings that come from pre-1.5 code you should be fine. If
it happens in 1.5+ code then generics handling is at fault.

- Lew
 
S

sakcee

Yes. You have "raw types" (GIYF) when you don't use generic decorations, and
the use of raw types causes this warning.


Yes. Either annotate the relevant code with '@SuppressWarnings( "unchecked")'
or rewrite your code to use generic decorations.

If you ignore the warnings that come from pre-1.5 code you should be fine. If
it happens in 1.5+ code then generics handling is at fault.

- Lew



Lew

Thanks for replying, I used wsdl2java tool to generate the stubs from
a deployed service. The server part is not in my control. can I still
use '@SuppressWarnings( "unchecked")'?

Would this means to rewrite the part that is generating the wsdl file
and service right i.e. server?

the only thing I am doing is
1- running wsdl
2- compiling those stubs which shows warnings.

Thanks
 
L

Lew

Thanks for replying, I used wsdl2java tool to generate the stubs from
a deployed service. The server part is not in my control. can I still
use '@SuppressWarnings( "unchecked")'?

Not on the server, nor any other code that you are not compiling. You only
write or change source that you compile, and vice versa.
Would this means to rewrite the part that is generating the wsdl file

The part of what?

You only change Java source with the idioms I suggested, not WSDL or schema.
and service right i.e. server?

I am not really understanding this wording.

You only change the Java source, if you change anything, that you generate.
From what you've said, I gather that you aren't compiling (or even rewriting)
the server code, so what we're saying here will not apply to that.

The downside to changing generated code is that you lose those changes every
time you regenerate the code. The upside is that you completely control the
result.
the only thing I am doing is
1- running wsdl

Do you mean "WSDL2Java"? I am not aware of any Axis executable called "wsdl".
2- compiling those stubs which shows warnings.

You can probably ignore the warnings, but if you don't want to do that, try
the other solutions mentioned.

- Lew
 
S

sakcee

Not on the server, nor any other code that you are not compiling. You only
write or change source that you compile, and vice versa.


The part of what?

You only change Java source with the idioms I suggested, not WSDL or schema.


I am not really understanding this wording.

You only change the Java source, if you change anything, that you generate.
From what you've said, I gather that you aren't compiling (or even rewriting)
the server code, so what we're saying here will not apply to that.

The downside to changing generated code is that you lose those changes every
time you regenerate the code. The upside is that you completely control the
result.


Do you mean "WSDL2Java"? I am not aware of any Axis executable called "wsdl".


You can probably ignore the warnings, but if you don't want to do that, try
the other solutions mentioned.

- Lew


Do you mean "WSDL2Java"? I am not aware of any Axis executable called "wsdl".

yes WSDL2Java,

yes I can supress the warnings in already generated stubs, but the
customer has to option to create stubs on fly and compile themselves ,
in this situation the supress code will be overwritten.

I do not understand why this error is occuring. It was not there in
jdk1.4,
Following are the only possibilities , that I can think of

1- WSDL2Java is not creating generic(type-safe) stubs when used with
axis 1.2.1 and jdk 1.5
2- WSDL file is incorrect i.e. the service is doing something wrong

if jdk1.5 started caring about generics, maybe the axis/wsdl2java
1.2.1 code is not writing generic/type safe stubs!!??
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

yes WSDL2Java,

yes I can supress the warnings in already generated stubs, but the
customer has to option to create stubs on fly and compile themselves ,
in this situation the supress code will be overwritten.

I do not understand why this error is occuring. It was not there in
jdk1.4,
Following are the only possibilities , that I can think of

1- WSDL2Java is not creating generic(type-safe) stubs when used with
axis 1.2.1 and jdk 1.5
2- WSDL file is incorrect i.e. the service is doing something wrong

if jdk1.5 started caring about generics, maybe the axis/wsdl2java
1.2.1 code is not writing generic/type safe stubs!!??

Axis (as in Axis1) is not Java 1.5 ready. It also uses
fields called enum.

Try compiling with:

-source 1.4 -target 1.4

Or upgrade to Axis2.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top