axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fawad Nazir (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2-1951) Axis2 Quick Start Guide is not working with JDK 1.5
Date Mon, 08 Jan 2007 03:18:27 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-1951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462936
] 

Fawad Nazir commented on AXIS2-1951:
------------------------------------

Got a reply from "Martin Gainty" <mgainty@hotmail.com>

> package samples.quickstart.service.pojo;

> 

> import java.util.HashMap;

> 

> public class StockQuoteService {

> //    private java.util.HashMap map = new HashMap();

> //remember templates in C++ well we can do the same thing here in our declaration
for HashMap

>    protected HashMap<String, Double> map = new HashMap<String, Double>();

> 

>    public double getPrice(String symbol) {

>        Double price = (Double) map.get(symbol);

>        if(price != null){

>            return price.doubleValue();

>        }

>        return 42.00;

>    }

> 

>    public void update(String symbol, double price)

>    {

>  //quick sanity check..MCG

>  if(!map.isEmpty())

>  { //technically map.put returns either previous value associated with key or null
if error

>         Object returned_object = map.put(symbol, new Double(price));

>     }

>    }

> }


A small correction:

orrection
the test for map.isEmpty is not needed for put so comment or delete that line

>    public void update(String symbol, double price)

>    {

>  //quick sanity check..MCG

>  if(!map.isEmpty())

>  { //technically map.put returns either previous value associated with key or null
if error

>         Object returned_object = map.put(symbol, new Double(price));

>     }

>    }

to
    public void update(String symbol, double price)
    {
 //technically map.put returns either previous value associated with key or null if
error
         Object returned_object = map.put(symbol, new Double(price));
    }

> Axis2 Quick Start Guide is not working with JDK 1.5
> ---------------------------------------------------
>
>                 Key: AXIS2-1951
>                 URL: https://issues.apache.org/jira/browse/AXIS2-1951
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>         Environment: java version "1.5.0_08"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode, sharing)
> Linux fawad-desktop 2.6.17-10-generic #2 SMP Tue Dec 5 22:28:26 UTC 2006
> i686 GNU/Linux
>            Reporter: Thilina Gunarathne
>            Priority: Blocker
>
> Creating a JIRA as per the request from an user..
> Hi,
> I am following the Axis2 Quick Start Guide section (Getting Ready).
> There are two steps for creating a WSDL file:
> 1.Create and compile the Java class.
> For this i am using the sample java class
> samples/quickstart/service/pojo/StockQuoteService.java.
> then i compiled the file.
> fawad@fawad-desktop:~/project/cobra/axis/axis2-1.1/samples/quickstart/src$
> javac samples/quickstart/service/pojo/StockQuoteService.javaNote:
> samples/quickstart/service/pojo/StockQuoteService.java uses unchecked or
> unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
> I got the above error, then i did this:
> fawad@fawad-desktop:~/project/cobra/axis/axis2-1.1/samples/quickstart/src$
> javac -Xlint:unchecked
> samples/quickstart/service/pojo/StockQuoteService.javasamples/quickstart/service/pojo/StockQuoteService.java:17:
> warning: [unchecked] unchecked call to put(K,V) as a member of the raw
> type java.util.HashMap
>        map.put(symbol, new Double(price));
>               ^
> 1 warning
> Then i got the above mentioned warning. Is there anyway to get rid of this
> warning??
> My java version is:
> fawad@fawad-desktop:~/project/cobra/axis/axis2-1.1/samples/quickstart/src$
> java -version
> java version "1.5.0_08"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode, sharing)
> 2.The step two was: Generate the WSDL using the following command:
> fawad@fawad-desktop:~/project/cobra/axis/axis2-1.1/samples/quickstart/src$
> $AXIS2_HOME/bin/java2wsdl.sh -cp . -cn
> samples.quickstart.service.pojo.StockQuoteService -of
> StockQuoteService.wsdl
> Using AXIS2_HOME:   /home/fawad/project/cobra/axis/axis2-1.1
>  Using JAVA_HOME:       /usr/lib/jvm/java-1.5.0-sun-1.5.0.08
> Unrecognized option: -cn
> Could not create the Java virtual machine.
> I got the above error. Please help me understand this and get rid of this.
> Thanks...
> --
> Fawad Nazir

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message