Axis 1.2.1 , JDK 1.5.0_07 Unecked or unsafe operations.

Discussion in 'Java' started by sakcee@gmail.com, Feb 13, 2007.

  1. Guest

    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
     
    , Feb 13, 2007
    #1
    1. Advertising

  2. Lew Guest

    wrote:
    >
    > 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
     
    Lew, Feb 13, 2007
    #2
    1. Advertising

  3. Guest

    Re: Axis 1.2.1 , JDK 1.5.0_07 Unecked or unsafe operations.

    On Feb 13, 2:53 pm, Lew <> wrote:
    > wrote:
    >
    > > 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




    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
     
    , Feb 13, 2007
    #3
  4. Lew Guest

    Re: Axis 1.2.1 , JDK 1.5.0_07 Unecked or unsafe operations.

    wrote:
    > 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
     
    Lew, Feb 13, 2007
    #4
  5. Guest

    Re: Axis 1.2.1 , JDK 1.5.0_07 Unecked or unsafe operations.

    On Feb 13, 3:48 pm, Lew <> wrote:
    > wrote:
    > > 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




    > 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!!??
     
    , Feb 14, 2007
    #5
  6. Re: Axis 1.2.1 , JDK 1.5.0_07 Unecked or unsafe operations.

    wrote:
    > 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
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Feb 14, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Axl
    Replies:
    2
    Views:
    15,635
    John C. Bollinger
    Sep 2, 2004
  2. Replies:
    0
    Views:
    940
  3. rockdale
    Replies:
    3
    Views:
    3,268
    rockdale
    Nov 3, 2006
  4. TsanChung
    Replies:
    0
    Views:
    597
    TsanChung
    Sep 3, 2008
  5. Roedy Green
    Replies:
    13
    Views:
    2,515
    Roedy Green
    Sep 2, 2012
Loading...

Share This Page