users@glassfish.java.net

Weird behaviour in ACC when using _at_WebServiceRef

From: Lukas Jungmann <Lukas.Jungmann_at_Sun.COM>
Date: Sat, 03 Mar 2007 02:36:16 +0100

Hi,

   I have following main class in my standalone appclient which I run
using appclient script (well, actually using NetBeans, but that's mostly
the same):

package applicationclient2;
import javax.xml.ws.WebServiceRef;
public class Main {

    @WebServiceRef(wsdlLocation =
"http://www.webservicex.net/CurrencyConvertor.asmx?wsdl")
    private static test.CurrencyConvertor service;

    public Main() {}

    public static void main(String[] args) {
        try {
            test.CurrencyConvertorSoap port =
service.getCurrencyConvertorSoap();
            test.Currency fromCurrency = null;
            test.Currency toCurrency = null;
            double result = port.conversionRate(fromCurrency, toCurrency);
            System.out.println("Result = "+result);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

and I'm seeing two different results:

with fresh installation of GF (v2-b38-nightly-2nb_March, JDK
1.6.0_01-b03 - I saw the same stacktrace also in non-fresh v2b35 and
v2b36 today) and after its first starts the injection does not work for
me. A part of the stacktrace is (sorry for not having the whole
stacktrace, I can't reproduce the problem right now:():

javax.xml.ws.WebServiceException:
{http://www.webserviceX.NET/}CurrencyConvertor is not a valid service.
Valid services are:
       at
com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:187)
       at
com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:159)
       at
com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:82)
       at javax.xml.ws.Service.<init>(Service.java:56)
       at cur.CurrencyConvertor.<init>(CurrencyConvertor.java:41)
       at applicationclient2.Main.main(Main.java:44)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

       at java.lang.reflect.Method.invoke(Method.java:597)
       at
com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:253)
       at
com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:339)

       at com.sun.enterprise.appclient.Main.main(Main.java:185)

now, when running 'maven checkout bootstrap-all' on GF sources in
different bash, I'm not able to reproduce the problem - all is running
as I would expect; I see:

AppContextID:
_home_lukas_NetBeansProjects_ApplicationClient2_dist_ApplicationClient2Client_jar
applicationclient2.Main/service
Result = 0.0

on the output and I'm not able to reproduce the problem described above
anymore (maybe it would be better to say not now), but why it behaves
differently when there's bigger traffic on the net?

There was also a similar stacktrace sent to nbusers_at_netbeans.org[1], but
we still don't know the cause of the problem.

--lj

[1]: http://www.netbeans.org/servlets/ReadMsg?list=nbusers&msgNo=85940