Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

Axis 1.2.1 , JDK 1.5.0_07   Unecked or unsafe operations.

Thread view: 
sakcee@gmail.com - 13 Feb 2007 20:13 GMT
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
Lew - 13 Feb 2007 22:53 GMT
> I am trying to compile the client side stubs generaed from
> a WSDL.
[quoted text clipped - 3 lines]
> 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
sakcee@gmail.com - 13 Feb 2007 23:21 GMT
> sak...@gmail.com wrote:
>
[quoted text clipped - 24 lines]
>
> - 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
Lew - 13 Feb 2007 23:48 GMT
> 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
sakcee@gmail.com - 14 Feb 2007 00:17 GMT
> sak...@gmail.com wrote:
> > Thanks for replying, I used wsdl2java tool to generate the stubs from
[quoted text clipped - 33 lines]
>
> - 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!!??
Arne Vajhøj - 14 Feb 2007 00:21 GMT
> yes WSDL2Java,
>
[quoted text clipped - 12 lines]
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.