Re: Initializing Web Service (Server) before first request received

2010-02-10 Thread Charles Galpin
I'm not sure I ever fully understood this, even after reading the docs on the 
service lifecycle a few times. What I found was that the methods did not fire 
the same way during hot deployment as they do on startup so don't get fooled by 
that. The best I came up with was use application scope, restart tomcat 
whenever I needed to apply a change, and the init method was the best place to 
put any one time setup code.

hth
charles

On Feb 10, 2010, at 5:23 AM, Doughty, Michael wrote:

> In your services.xml file, add 'scope=" application"' to the "service" 
> element, as follows:
> 
> 
> 
> The service will then be deployable in application mode.
> 
> Now a question to Deepal... will this actually load the implementation class 
> immediately on deployment and thus cause all static initialization in the 
> class to take place?
> 
> I know that application mode will cause Axis2 to treat the implementation 
> class as a singleton and reuse the same instance for each service call, but I 
> was still under the impression that it would require that first service call 
> to be made still.  If the class is loaded on deployment or the singleton is 
> constructed prior to the first service call, then that is definitely good 
> news.
> 
> -Original Message-
> From: Oded Onn [mailto:oded@mobixell.com] 
> Sent: Wednesday, February 10, 2010 3:21 AM
> To: axis-user@ws.apache.org
> Subject: RE: Initializing Web Service (Server) before first request received
> 
> Deepal,
> Can you please elaborate a bit more. I am not sure I quite understand
> what you mean.
> Thanks,
> Oded
> 
> -Original Message-
> From: Deepal Jayasinghe [mailto:dee...@opensource.lk] 
> Sent: Wednesday, February 10, 2010 00:58
> To: axis-user@ws.apache.org
> Subject: Re: Initializing Web Service (Server) before first request
> received
> 
> Deploy there service in Application scope.
> 
> Thanks,
> Deepal
>> 
>> Hi all,
>> 
>> 
>> 
>> I am deploying an AXIS2 web service (server side).
>> 
>> 
>> 
>> My problem: The skeleton class (the one that performs all the business
>> logic) is read for the first time only when the first request is
>> received by the server. It means that the first response takes a
>> really long time (up to 20 seconds on a weak machine) since there are
>> a lot of initialization I have to perform (static init).
>> 
>> 
>> 
>> Solution: I am assuming I can write some sort of a main class that
>> will try to call the skeleton class. This is not only ugly but also
>> prone to all sorts of errors. Is there a proper way to init my service
>> class? I would expect some mechanism to be used, such as utilizing the
>> servlet init of the axis servlet.
>> 
>> 
>> 
>> Anyone? Thanks!
>> 
>> Oded
>> 
> 
> -- 
> Thank you!
> 
> 
> http://blogs.deepal.org
> http://deepal.org
> 



Re: change EPR

2010-02-10 Thread Charles Galpin
http://amilachinthaka.blogspot.com/2010/01/changing-axis2-application-path.html

hth
charles

On Feb 10, 2010, at 4:16 AM, Sandeep Khurana wrote:

> I am creating simple pojo webservice like TemperatureConversion. I was able 
> to make deploy it and generate wsdl from it.
> The problem is that I want to change the EPR / address 
> fromhttp://172.x.x.x:8080/MyWebservice/services/TemperatureConversion 
> tohttp://172.x.x.x:8080/MyWebservice/TemperatureConversion
> Is that possible?
> Thanks.



Re: archive lib directory and 3rd party libraries (axis2/tomcat 6)

2010-01-27 Thread Charles Galpin
Thanks for your help with this Andreas

I put a bunch of debug statements in various places and found the 
WebappClassLoader was being used consistently throughout.

I still don't understand what was happening in this SQLException case, but I 
did end up finding my problem(s) stem from the use of a singleton class in the 
legacy code I am using that is effectively thwarting what I want to do anyway. 

Thanks again,
charles

On Jan 25, 2010, at 4:36 PM, Andreas Veithen wrote:

> On Mon, Jan 25, 2010 at 22:15, Charles Galpin  wrote:
>> Hi Andreas
>> 
>> I tried setting the TCCL to both the class loader of the service context as 
>> well as the service group context before starting the threaD, but still no 
>> change. I guess this leaves me with a couple of questions.
>> 
>> 1. Do subsequent threads spawned inherit the same TCCL? I'm pretty sure 
>> other threads are spawned by this thread which then go on to do the work.
> 
> I think that the constructor of java.lang.Thread takes over the TCCL
> from the current thread. The Javadoc of java.lang.Thread should give a
> detailed explanation of this.
> 
>> 2. How can I tell what class loader is being used? Just log whatever 
>> this.getClassLoader() returns anywhere I care?
> 
> Thread.currentThread().getContextClassLoader() (not to be confused
> with Class#getClassLoader())
> 
>> 3. Is init perhaps the wrong place to be firing this off? I originally tried 
>> in the startUp method but iirc member variables initialized here were not 
>> retained when the service methods were invoked.
> 
> Unfortunately I'm not familiar enough with the lifecycle methods to
> answer that question.



Re: archive lib directory and 3rd party libraries (axis2/tomcat 6)

2010-01-25 Thread Charles Galpin
Hi Andreas

I tried setting the TCCL to both the class loader of the service context as 
well as the service group context before starting the threaD, but still no 
change. I guess this leaves me with a couple of questions.

1. Do subsequent threads spawned inherit the same TCCL? I'm pretty sure other 
threads are spawned by this thread which then go on to do the work.
2. How can I tell what class loader is being used? Just log whatever 
this.getClassLoader() returns anywhere I care?
3. Is init perhaps the wrong place to be firing this off? I originally tried in 
the startUp method but iirc member variables initialized here were not retained 
when the service methods were invoked.

thanks,
charles

On Jan 25, 2010, at 3:57 PM, Andreas Veithen wrote:

> Charles,
> 
> That might actually explain the issue. Here is some additional info:
> 
> * ORB.init looks up classes from the thread context class loader (I
> checked that in the JRE sources).
> * ServiceTCCL=composite means that Axis2 sets the TCCL to the service
> class loader when entering a service method and resets it after the
> method exits.
> * A new thread that is being created inherits the TCCL from its parent
> thread (see Javadoc of java.lang.Thread).
> 
> However, it is possible that Axis2 doesn't take the ServiceTCCL
> property into account when executing a lifecycle method (maybe that
> should be considered as a bug). This would mean that your thread ends
> up with the TCCL set to the Web app class loader. Since the thread is
> managed by your service, you can obviously set the TCCL for that
> thread to whatever you want (It will have no impact on Axis2 nor on
> the servlet container). I would try to set it to the service class
> loader (You should be able to get a reference to that class loader
> from the parameters passed to the lifecycle method).
> 
> Andreas



Re: archive lib directory and 3rd party libraries (axis2/tomcat 6)

2010-01-25 Thread Charles Galpin
It's just a thread spawned from the lifecycle init method using new Thread()… 
The general idea is we have an existing code base that used to be launched as 
commandline apps. I am now launching them in a thread from my web services, and 
"web enabling" them.  Admittedly there were not designed or built to be used 
this way, but I don't think there should be anything stopping me from doing 
this.

The Corba initialization occurs in the client.corba.* packages, but they are 
just calling org.omg.CORBA.ORB.init which is doing the class loading and thats 
from rt.jar in the java distro afaik. The ORB loaded is a configurable option 
which is why it uses the class loader (IE not in my control).

I got past this one by putting the corba.jar into WEB-INF/lib.

The SQLException I describe below occurs when a call is made to 
DriveManager.getConnection(..) and works fine loading a single service/.aar

charles

On Jan 25, 2010, at 3:12 PM, Andreas Veithen wrote:

> Charles,
> 
> According to the stack trace you posted, the error occurs inside a
> thread that is neither managed by the servlet container, nor by Axis2:
> 
> 13:38:58 DEBUG- Stack trace: org.omg.CORBA.INITIALIZE: can't
> instantiate default ORB implementation org.jacorb.orb.ORB  vmcid: 0x0
> minor code: 0  completed: No
>at org.omg.CORBA.ORB.create_impl(ORB.java:297)
>at org.omg.CORBA.ORB.init(ORB.java:336)
>at client.corba.BaseCORBAApp.initCORBA(BaseCORBAApp.java:134)
>at 
> client.corba.BaseCORBAService.startService(BaseCORBAService.java:100)
>at 
> client.project.dcol.publish.corba.WebServiceDataCollectionService.webInit(WebServiceDataCollectionService.java:170)
>at 
> client.project.dcol.GDPI.ServiceBase$ServiceThread.run(ServiceBase.java:318)
>at java.lang.Thread.run(Thread.java:619)
> 
> How and where is this thread created?
> 
> Andreas
> 
> On Mon, Jan 25, 2010 at 20:23, Charles Galpin  wrote:
>> Thanks Andreas
>> 
>> I added this to both services being loaded, rebuilt and ran, but no change.
>> 
>> The composite class loader was one of the options described in Amil's blog 
>> and as I understand it, it is supposed to use both the TCCL and the service 
>> class loader. But I guess I still don't understand the class loading because 
>> this jar is in all the places the class loaders should be looking so I don't 
>> see how it matters which one it uses.
>> 
>> I also tried the "EnableChildFirstClassLoading" parameter as well but no 
>> help.
>> 
>> Thanks,
>> charles
>> 
>> On Jan 25, 2010, at 1:53 PM, Andreas Veithen wrote:
>> 
>>> Try adding the following parameter on the service:
>>> 
>>> composite
>>> 
>>> Andreas
>>> 
>>> On Mon, Jan 25, 2010 at 18:22, Charles Galpin  wrote:
>>>> Hi All
>>>> I am still running into problems with this.  I previously moved all the 
>>>> jars
>>>> I needed into the WEB-INF/lib directory and was able to continue working.
>>>> But as I add more services (more .aar files) I am now running into strange
>>>> unpredictable differences that I do not understand.
>>>> For example, I have two services packaged in their own .aar files and if
>>>> deployed independently they run just fine. Simply deploying both together
>>>> causes the second one loaded to have mysterious problems like a
>>>> java.sql.SQLException "no suitable driver found for jdbc:sqlserver://.."
>>>> when the sql3jdbc jar file is in both the .aar and WEB-INF/lib directory 
>>>> and
>>>> (and as I said works fine standalone).
>>>> Does anyone have any advice on how to get my services to run together
>>>> happily? Assume I am not concerned with isolating each service from each
>>>> other in terms of security.  I read on Amila's blog that some class loading
>>>> settings can be modified but it's not clear exactly what ramifications it
>>>> will have or if it will even help my problems.
>>>> I am not sure if this is causing my problems, but due to wanting to be able
>>>> to override the properties file in the .aar file when deployed in different
>>>> environments, in the service lifecycle init method I attempt to find the
>>>> properties file in the axis classpath before trying the .arr, using first
>>>> axisService.getClass().getClassLoader(0.gerResourceAsStream(propsFilename);
>>>> and if not found then using
>>>> this.getClass().getClassLoader(0.gerResourceAsStream(propsFilename);
>>>> C

Re: archive lib directory and 3rd party libraries (axis2/tomcat 6)

2010-01-25 Thread Charles Galpin
Thanks Andreas

I added this to both services being loaded, rebuilt and ran, but no change.

The composite class loader was one of the options described in Amil's blog and 
as I understand it, it is supposed to use both the TCCL and the service class 
loader. But I guess I still don't understand the class loading because this jar 
is in all the places the class loaders should be looking so I don't see how it 
matters which one it uses.

I also tried the "EnableChildFirstClassLoading" parameter as well but no help.

Thanks,
charles

On Jan 25, 2010, at 1:53 PM, Andreas Veithen wrote:

> Try adding the following parameter on the service:
> 
> composite
> 
> Andreas
> 
> On Mon, Jan 25, 2010 at 18:22, Charles Galpin  wrote:
>> Hi All
>> I am still running into problems with this.  I previously moved all the jars
>> I needed into the WEB-INF/lib directory and was able to continue working.
>> But as I add more services (more .aar files) I am now running into strange
>> unpredictable differences that I do not understand.
>> For example, I have two services packaged in their own .aar files and if
>> deployed independently they run just fine. Simply deploying both together
>> causes the second one loaded to have mysterious problems like a
>> java.sql.SQLException "no suitable driver found for jdbc:sqlserver://.."
>> when the sql3jdbc jar file is in both the .aar and WEB-INF/lib directory and
>> (and as I said works fine standalone).
>> Does anyone have any advice on how to get my services to run together
>> happily? Assume I am not concerned with isolating each service from each
>> other in terms of security.  I read on Amila's blog that some class loading
>> settings can be modified but it's not clear exactly what ramifications it
>> will have or if it will even help my problems.
>> I am not sure if this is causing my problems, but due to wanting to be able
>> to override the properties file in the .aar file when deployed in different
>> environments, in the service lifecycle init method I attempt to find the
>> properties file in the axis classpath before trying the .arr, using first
>> axisService.getClass().getClassLoader(0.gerResourceAsStream(propsFilename);
>> and if not found then using
>> this.getClass().getClassLoader(0.gerResourceAsStream(propsFilename);
>> Could this be messing up the class loading sequence, and if yes, how can I
>> achieve the same effect without using the axis class loader first?
>> thanks,
>> charles
>> On Dec 1, 2009, at 2:29 PM, Charles Galpin wrote:
>> 
>> Hi Sameera
>> Ok, this is starting to make a little more sense. I was not aware the
>> WebappClassLoader could not see classes in the .aar. Can this be changed?
>> I have access to the source of the client.corba.* packages, but they are
>> just calling org.omg.CORBA.ORB.init which is doing the class loading and
>> thats from rt.jar in the java distro afaik. The ORB loaded is a configurable
>> option which is why it uses the class loader.
>> Here is another exception stack you may find useful. I had run into this
>> problem as well as various other classes not loading a while ago and made a
>> few changes until getting my service working, and one of them was to pass
>> -Djava.library.path="%PATH%;blahblah" in on the commandline when starting
>> tomcat. Removing this changes the error to a perhaps little more revealing
>> message (after understanding about the TCCL limitation)
>> 13:38:58 ERROR- Error initializing CORBA ORB. Unexpected CORBA error.
>> org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation
>> org.jacorb.orb.ORB  vmcid: 0x0  minor code: 0  completed: No
>> 13:38:58 DEBUG- Stack trace: org.omg.CORBA.INITIALIZE: can't instantiate
>> default ORB implementation org.jacorb.orb.ORB  vmcid: 0x0  minor code: 0
>>  completed: No
>> at org.omg.CORBA.ORB.create_impl(ORB.java:297)
>> at org.omg.CORBA.ORB.init(ORB.java:336)
>> at client.corba.BaseCORBAApp.initCORBA(BaseCORBAApp.java:134)
>> at
>> client.corba.BaseCORBAService.startService(BaseCORBAService.java:100)
>> at
>> client.project.dcol.publish.corba.WebServiceDataCollectionService.webInit(WebServiceDataCollectionService.java:170)
>> at
>> client.project.dcol.GDPI.ServiceBase$ServiceThread.run(ServiceBase.java:318)
>> at java.lang.Thread.run(Thread.java:619)
>> Caused by: java.lang.ClassNotFoundException: org.jacorb.orb.ORB
>> at
>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
>> at
>>

Re: archive lib directory and 3rd party libraries (axis2/tomcat 6)

2010-01-25 Thread Charles Galpin
Hi All

I am still running into problems with this.  I previously moved all the jars I 
needed into the WEB-INF/lib directory and was able to continue working. But as 
I add more services (more .aar files) I am now running into strange 
unpredictable differences that I do not understand.

For example, I have two services packaged in their own .aar files and if 
deployed independently they run just fine. Simply deploying both together 
causes the second one loaded to have mysterious problems like a 
java.sql.SQLException "no suitable driver found for jdbc:sqlserver://.." when 
the sql3jdbc jar file is in both the .aar and WEB-INF/lib directory and (and as 
I said works fine standalone).

Does anyone have any advice on how to get my services to run together happily? 
Assume I am not concerned with isolating each service from each other in terms 
of security.  I read on Amila's blog that some class loading settings can be 
modified but it's not clear exactly what ramifications it will have or if it 
will even help my problems.

I am not sure if this is causing my problems, but due to wanting to be able to 
override the properties file in the .aar file when deployed in different 
environments, in the service lifecycle init method I attempt to find the 
properties file in the axis classpath before trying the .arr, using first

axisService.getClass().getClassLoader(0.gerResourceAsStream(propsFilename);

and if not found then using

this.getClass().getClassLoader(0.gerResourceAsStream(propsFilename);

Could this be messing up the class loading sequence, and if yes, how can I 
achieve the same effect without using the axis class loader first?

thanks,
charles

On Dec 1, 2009, at 2:29 PM, Charles Galpin wrote:

> Hi Sameera
> 
> Ok, this is starting to make a little more sense. I was not aware the 
> WebappClassLoader could not see classes in the .aar. Can this be changed?
> 
> I have access to the source of the client.corba.* packages, but they are just 
> calling org.omg.CORBA.ORB.init which is doing the class loading and thats 
> from rt.jar in the java distro afaik. The ORB loaded is a configurable option 
> which is why it uses the class loader.
> 
> Here is another exception stack you may find useful. I had run into this 
> problem as well as various other classes not loading a while ago and made a 
> few changes until getting my service working, and one of them was to pass 
> -Djava.library.path="%PATH%;blahblah" in on the commandline when starting 
> tomcat. Removing this changes the error to a perhaps little more revealing 
> message (after understanding about the TCCL limitation)
> 
> 13:38:58 ERROR- Error initializing CORBA ORB. Unexpected CORBA error. 
> org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation 
> org.jacorb.orb.ORB  vmcid: 0x0  minor code: 0  completed: No
> 13:38:58 DEBUG- Stack trace: org.omg.CORBA.INITIALIZE: can't instantiate 
> default ORB implementation org.jacorb.orb.ORB  vmcid: 0x0  minor code: 0  
> completed: No
> at org.omg.CORBA.ORB.create_impl(ORB.java:297)
> at org.omg.CORBA.ORB.init(ORB.java:336)
> at client.corba.BaseCORBAApp.initCORBA(BaseCORBAApp.java:134)
> at 
> client.corba.BaseCORBAService.startService(BaseCORBAService.java:100)
> at 
> client.project.dcol.publish.corba.WebServiceDataCollectionService.webInit(WebServiceDataCollectionService.java:170)
> at 
> client.project.dcol.GDPI.ServiceBase$ServiceThread.run(ServiceBase.java:318)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.ClassNotFoundException: org.jacorb.orb.ORB
> at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
> at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at org.omg.CORBA.ORB.create_impl(ORB.java:295)
> ... 6 more
> 13:38:58 ERROR- Aborted due to startup failure.
> Aborted due to startup failure: Error initializing CORBA ORB. Unexpected 
> CORBA error.
> 
> Is there any other way to work around this other than putting the libraries 
> in the axis2/WEB-INF/lib directory? To be clear I have other problems beside 
> this. A good example is we have a custom log4j appender we use which is in 
> Shared.jar. This cannot be found either unless it's in axis2/WEB-INF/lib but 
> your description explains that one too.
> 
> thanks,
> charles
> 
> On Dec 1, 2009, at 1:28 PM, Sameera Jayasoma wrote:
> 
>> Hi Charles
>> 
>> On Tue, Dec 1, 2009 at 11:27 PM, Charles Galpin  wrote:
>> Hi Sameera
&g

Re: XSLT link in WSDL removed when deployed

2009-12-04 Thread Charles Galpin
Hi Håkon

Axis generates it's own WSDL dynamically. If you want to serve a static copy of 
it you have to edit the services.xml and  ser a parameter "useOriginalwsdl" to 
true and possibly "modifyUserWSDLPortAddress" to false in order to serve your 
original WSDL.

hth
charles

On Dec 3, 2009, at 3:31 AM, Håkon Sagehaug wrote:

> Hi all,
> 
> I got a service with a WSDL that contains a link to a XSLT stylesheet, but 
> when i deploy my service it looks like the link is removed from the WSDL, 
> anyone experienced this before ?
> 
> 
> 
> cheers, Håkon
> 



Re: archive lib directory and 3rd party libraries (axis2/tomcat 6)

2009-12-01 Thread Charles Galpin
Hi Sameera

Ok, this is starting to make a little more sense. I was not aware the 
WebappClassLoader could not see classes in the .aar. Can this be changed?

I have access to the source of the client.corba.* packages, but they are just 
calling org.omg.CORBA.ORB.init which is doing the class loading and thats from 
rt.jar in the java distro afaik. The ORB loaded is a configurable option which 
is why it uses the class loader.

Here is another exception stack you may find useful. I had run into this 
problem as well as various other classes not loading a while ago and made a few 
changes until getting my service working, and one of them was to pass 
-Djava.library.path="%PATH%;blahblah" in on the commandline when starting 
tomcat. Removing this changes the error to a perhaps little more revealing 
message (after understanding about the TCCL limitation)

13:38:58 ERROR- Error initializing CORBA ORB. Unexpected CORBA error. 
org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation 
org.jacorb.orb.ORB  vmcid: 0x0  minor code: 0  completed: No
13:38:58 DEBUG- Stack trace: org.omg.CORBA.INITIALIZE: can't instantiate 
default ORB implementation org.jacorb.orb.ORB  vmcid: 0x0  minor code: 0  
completed: No
at org.omg.CORBA.ORB.create_impl(ORB.java:297)
at org.omg.CORBA.ORB.init(ORB.java:336)
at client.corba.BaseCORBAApp.initCORBA(BaseCORBAApp.java:134)
at client.corba.BaseCORBAService.startService(BaseCORBAService.java:100)
at 
client.project.dcol.publish.corba.WebServiceDataCollectionService.webInit(WebServiceDataCollectionService.java:170)
at 
client.project.dcol.GDPI.ServiceBase$ServiceThread.run(ServiceBase.java:318)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.jacorb.orb.ORB
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.omg.CORBA.ORB.create_impl(ORB.java:295)
... 6 more
13:38:58 ERROR- Aborted due to startup failure.
Aborted due to startup failure: Error initializing CORBA ORB. Unexpected CORBA 
error.

Is there any other way to work around this other than putting the libraries in 
the axis2/WEB-INF/lib directory? To be clear I have other problems beside this. 
A good example is we have a custom log4j appender we use which is in 
Shared.jar. This cannot be found either unless it's in axis2/WEB-INF/lib but 
your description explains that one too.

thanks,
charles

On Dec 1, 2009, at 1:28 PM, Sameera Jayasoma wrote:

> Hi Charles
> 
> On Tue, Dec 1, 2009 at 11:27 PM, Charles Galpin  wrote:
> Hi Sameera
> 
> Yes this is what is happening and what is expected. The 
> org.omg.CosNotifyFilter.InvalidGrammar class is in jacorb.jar which is in the 
> .aar lib directory. What am I missing? Are you saying it should not be in the 
> thread context class loader?
> 
> The class BaseCORBAApp is trying to loadInvalidGrammar class from the TCCL 
> and in this scenario TCCL is set to the WebappClassLoader. Classes in your 
> aar lib folder cannot be seen by the WebappClassLoader. It can only see the 
> classes in axis2/WEB-INF/lib folder or in the application classpath 
> tomcat/lib. That is things work nicely when you put jacob.jar to 
> axis2/WEB-INF/lib.
> 
> Do you have access to sources of the classes in client.corba.* packages.
> 
> Thanks
> sameera
>  
> 
> On Dec 1, 2009, at 12:47 PM, Sameera Jayasoma wrote:
> 
> > It seems that "BaseCORBAApp" class is trying to load 
> > "org.omg.CosNotifyFilter.InvalidGrammar" from the thread context class 
> > loader. That is why you see following lines in the exception log.
> >
> >  at 
> > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
> >  at 
> > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
> >
> >  This is a usual practice of loading application libraries. If you have 
> > access to the source code of client.corba classes, you can verify this.
> >
> > Thanks
> > Sameera
> 
> 
> Thanks Olindo, but the first error (see the bottom of the trace) is 
> java.lang.ClassNotFoundException which I believe is the root cause. I have 
> checked and jacorb.jar is not in the path or classpath.
> 
> On Dec 1, 2009, at 11:55 AM, Olindo Pindaro wrote:
> 
> > The exception  isn't "ClassNotFound" but "NoClassDefFoundError", that in my 
> > experience is caused by conflit in differente version of library present in 
> > compiler path and classloaderpath.
> 
> thanks,
> charles
> 
> 
> 
> 
> -- 
> Sameera Jayasoma
> Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
> 
> blog: http://tech.jayasoma.org



Re: archive lib directory and 3rd party libraries (axis2/tomcat 6)

2009-12-01 Thread Charles Galpin
Hi Sameera

Yes this is what is happening and what is expected. The 
org.omg.CosNotifyFilter.InvalidGrammar class is in jacorb.jar which is in the 
.aar lib directory. What am I missing? Are you saying it should not be in the 
thread context class loader?

On Dec 1, 2009, at 12:47 PM, Sameera Jayasoma wrote:

> It seems that "BaseCORBAApp" class is trying to load 
> "org.omg.CosNotifyFilter.InvalidGrammar" from the thread context class 
> loader. That is why you see following lines in the exception log.
> 
>  at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
>  at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
> 
>  This is a usual practice of loading application libraries. If you have 
> access to the source code of client.corba classes, you can verify this. 
> 
> Thanks
> Sameera


Thanks Olindo, but the first error (see the bottom of the trace) is 
java.lang.ClassNotFoundException which I believe is the root cause. I have 
checked and jacorb.jar is not in the path or classpath.

On Dec 1, 2009, at 11:55 AM, Olindo Pindaro wrote:

> The exception  isn't "ClassNotFound" but "NoClassDefFoundError", that in my 
> experience is caused by conflit in differente version of library present in 
> compiler path and classloaderpath.

thanks,
charles



Re: archive lib directory and 3rd party libraries (axis2/tomcat 6)

2009-12-01 Thread Charles Galpin
Hi Sameera

Here is the exception and the jar list. The exception isn't terribly telling 
(to me) other than it can't find org/omg/CosNotifyFilter/InvalidGrammar which 
is in jacorb.jar. Once I drop jacorb.jar under axis2/WEB-INF/lib this error 
goes away.

Exception in thread "LinkDIModule" java.lang.NoClassDefFoundError: 
org/omg/CosNotifyFilter/InvalidGrammar
at client.corba.BaseCORBAApp.initCORBA(BaseCORBAApp.java:153)
at client.corba.BaseCORBAService.startService(BaseCORBAService.java:100)
at 
client.project.dcol.publish.corba.WebServiceDataCollectionService.webInit(WebServiceDataCollectionService.java:170
)
at 
client.project.dcol.GDPI.ServiceBase$ServiceThread.run(ServiceBase.java:318)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: 
org.omg.CosNotifyFilter.InvalidGrammar
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 5 more

Some of these are 3rd party jars and some are our own.

511Shared.jar
avalon-framework-4.1.5.jar
DetectorStationApp.jar
GDPIService.jar
jacorb.jar
joesnmp.jar
LinkDIModule.jar
logkit-1.2.jar
Shared.jar
sqljdbc4.jar

I have increased logging to debug level but don't see how to get more info than 
this.

thanks,
charles

On Nov 30, 2009, at 11:47 PM, Sameera Jayasoma wrote:

> Hi Charles,
> 
> Its really hard to comment on this without looking at the exception log and 
> the list of jar files that you are putting into aar lib folder. Its better if 
> can attached the exception log and the name of the jar files that you using.
> 
> Thanks
> Sameera
> 
> On Mon, Nov 30, 2009 at 10:36 PM, Charles Galpin  wrote:
> Does anyone have any thoughts on this? I have verified the jar file is in the 
> lib directory of my .aar file, and other classes and jars are loaded fine.
> 
>  
> 
> thanks,
> charles
> 
> On Nov 25, 2009, at 5:49 PM, Charles Galpin wrote:
> 
> > Some jar files in my .aar lib directory do not appear to be loaded or 
> > recognized (I get ClassNotFound exceptions).  If I put the jars in 
> > axis2/WEB-INF/lib directory they are loaded fine.  Other jars are loaded 
> > fine so I don't think it's me putting them in the wrong place in the .aar.
> >
> > Any suggestions on how to debug this?
> >
> > TIA,
> > charles



Re: archive lib directory and 3rd party libraries (axis2/tomcat 6)

2009-11-30 Thread Charles Galpin
Does anyone have any thoughts on this? I have verified the jar file is in the 
lib directory of my .aar file, and other classes and jars are loaded fine.

thanks,
charles

On Nov 25, 2009, at 5:49 PM, Charles Galpin wrote:

> Some jar files in my .aar lib directory do not appear to be loaded or 
> recognized (I get ClassNotFound exceptions).  If I put the jars in 
> axis2/WEB-INF/lib directory they are loaded fine.  Other jars are loaded fine 
> so I don't think it's me putting them in the wrong place in the .aar.
> 
> Any suggestions on how to debug this?
> 
> TIA,
> charles



archive lib directory and 3rd party libraries (axis2/tomcat 6)

2009-11-25 Thread Charles Galpin
Some jar files in my .aar lib directory do not appear to be loaded or 
recognized (I get ClassNotFound exceptions).  If I put the jars in 
axis2/WEB-INF/lib directory they are loaded fine.  Other jars are loaded fine 
so I don't think it's me putting them in the wrong place in the .aar.

Any suggestions on how to debug this?

TIA,
charles

Re: How to read parameter in WebService

2009-11-25 Thread Charles Galpin
No, never used Axis1, sorry.

On Nov 25, 2009, at 4:00 AM, Pietro Romanazzi wrote:

> Thanks Charles,
> good hint for Axis2.
> Any idea for Axis 1.4?
> Regards,
> pietro
>> You need to get a reference to the AxisService and then you can do 
>> 
>> axisService.getParameterValue("myname");
>> 
>> AxisService is provided in some lifecycle methods, in others like the init 
>> method you need
>> 
>> axisService = serviceContext.getAxisService();
>> 
>> hth,
>> charles
>> 
>> On Nov 24, 2009, at 1:14 PM, Pietro Romanazzi wrote:
>> 
>>> Hi,
>>> this is a very old issue.
>>> Could anyone help please?
>>> 
>>> i declared a parameter "myname" in my wsdd file:
>>> http://xml.apache.org/axis/wsdd/";
>>>xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
>>>  
>>>
>>>
>>>
>>>  
>>> 
>>> 
>>> how can i read this parameter in my webservice classes?
>>> Kindest regards,
>>> 
>>> Pietro Romanazzi
>>> InnovaPuglia S.p.a
>>> Centro Tecnico RUPAR Puglia
>>> 
>>> 
>> 
>> 
> 
> 
> 



Re: How to read parameter in WebService

2009-11-24 Thread Charles Galpin
You need to get a reference to the AxisService and then you can do 

axisService.getParameterValue("myname");

AxisService is provided in some lifecycle methods, in others like the init 
method you need

axisService = serviceContext.getAxisService();

hth,
charles

On Nov 24, 2009, at 1:14 PM, Pietro Romanazzi wrote:

> Hi,
> this is a very old issue.
> Could anyone help please?
> 
> i declared a parameter "myname" in my wsdd file:
> http://xml.apache.org/axis/wsdd/";
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
>   
> 
> 
> 
>   
> 
> 
> how can i read this parameter in my webservice classes?
> Kindest regards,
> 
> Pietro Romanazzi
> InnovaPuglia S.p.a
> Centro Tecnico RUPAR Puglia
> 
>   



Re: [Axis2] Setting nillable = false in WSDL

2009-11-13 Thread Charles Galpin
There are open bugs on this and related issues with the wsdl  
generation. Please vote for them if you care about these kinds of  
issues as this should help them get priority.


http://issues.apache.org/jira/browse/AXIS2

thanks,
charles

On Nov 13, 2009, at 7:50 AM, Didav Didav wrote:



Hi All,

I am using Axis2 1.3 and jdk 1.5 and tomcat 6

The WSDL file generated by Axis sets  the element "nillable=true",  
but i want to set "nillable=false"...


Exemple :


  
type="xs:boolean"/>
type="xs:string"/>

  



Is there any way I can get the 'nillable' property to true or false  
in a

declarative fashion..

I try with the annotation @XmlElement(nillable = false,  
required=true) but it doesn't work :(


Thanks a lot,

David


PC, téléphones portables, souris hi-tech. à gagner grâce à Hotmail !  
C'est ici !




Re: tracking down reason for AxisFault fromIllegalArgumentException

2009-11-02 Thread Charles Galpin

Hi Deepal

I have submitted a bug report for this,

http://issues.apache.org/jira/browse/AXIS2-4541

Also, I had thought that I had this working with another service, but  
it turns out it doesn't work either. I got different errors for that  
one - it seemed to be getting a large number of spaces for the input  
variables. But take a look at this one and I can submit a test case  
for the other if needed.


TIA,
charles

On Oct 30, 2009, at 8:40 PM, Deepal jayasinghe wrote:


hi Charles,

I remember I fixed this issue sometimes ago, but now it has appear  
again

in 1.5 and 1.5.1 release. If you can please create a JIRA issues (or
else I can create one).

It is hard for me to give the exact answer without looking at your
service, if there is any possibility of creating a jira and  
attaching a

service that would help us a lot.

Thanks,
Deepal

Hi All

First time poster using axis2-1.5

I have a POJO based service which works fine other than axis has a  
bug
that generates minOccurs="0" in the auto generated WSDL for all  
method

parameters, even though they are required. So I am trying to work
around this using a method I have used on other services - serving a
static WSDL.  I took the auto-generated WSDL, made a few minor  
changes

to the method parameters to be minOccurs="1" ,  copy it to the
META-INF directory as part of my build, and in services.xml added the
parameter useOriginalwsdl=true.

Now I get this obscure fault when invoking the method that I can't
figure out. How do I determine why I'm getting an
IllegalArgumentException with no other changes? I have full DEBUG
level logging enabled but it gives no useful info (to me anyway) :)

thanks,
charles



Re: tracking down reason for AxisFault from IllegalArgumentException

2009-10-31 Thread Charles Galpin
Hi Deepal

This is pretty entrenched in our code base including the build. I'll make a 
paired down version that will hopefully display the problem and create a 
report, thanks. But as I said it works on another service so not sure what the 
difference is.

To be clear we are talking about the error and not the minOccurs fix right? I 
looked and it didn't looked like the existing reports for the minOccurs issue 
were ever addressed, and this is the core problem. But I'd be happy with a work 
around or fix for this either way :)

thanks,
charles

- Original Message -
From: "Deepal jayasinghe" 
To: axis-user@ws.apache.org
Sent: Friday, October 30, 2009 8:40:12 PM GMT -05:00 US/Canada Eastern
Subject: Re: tracking down reason for AxisFault fromIllegalArgumentException

hi Charles,

I remember I fixed this issue sometimes ago, but now it has appear again
in 1.5 and 1.5.1 release. If you can please create a JIRA issues (or
else I can create one).

It is hard for me to give the exact answer without looking at your
service, if there is any possibility of creating a jira and attaching a
service that would help us a lot.

Thanks,
Deepal
> Hi All
>
> First time poster using axis2-1.5
>
> I have a POJO based service which works fine other than axis has a bug
> that generates minOccurs="0" in the auto generated WSDL for all method
> parameters, even though they are required. So I am trying to work
> around this using a method I have used on other services - serving a
> static WSDL.  I took the auto-generated WSDL, made a few minor changes
> to the method parameters to be minOccurs="1" ,  copy it to the
> META-INF directory as part of my build, and in services.xml added the
> parameter useOriginalwsdl=true.
>
> Now I get this obscure fault when invoking the method that I can't
> figure out. How do I determine why I'm getting an
> IllegalArgumentException with no other changes? I have full DEBUG
> level logging enabled but it gives no useful info (to me anyway) :)
>
> thanks,
> charles
>
>
> org.apache.axis2.AxisFault
>
> at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>
> at
> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:161)
>
>
> at
> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
>
>
> at
> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
>
>
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
>
> at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167)
>
>
> at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:142)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>
>
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>
>
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>
>
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>
>
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>
>
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>
> at java.lang.Thread.run(Thread.java:619)
>
> Caused by: java.lang.IllegalArgumentException
>
> 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
> org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
>
>
> at
> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102)
>
>
> ... 19 more
>


-- 
Thank you!


http://blogs.deepal.org
http://deepal.org



tracking down reason for AxisFault fromIllegalArgumentException

2009-10-30 Thread Charles Galpin

Hi All

First time poster using axis2-1.5

I have a POJO based service which works fine other than axis has a bug  
that generates minOccurs="0" in the auto generated WSDL for all method  
parameters, even though they are required. So I am trying to work  
around this using a method I have used on other services - serving a  
static WSDL.  I took the auto-generated WSDL, made a few minor changes  
to the method parameters to be minOccurs="1" ,  copy it to the META- 
INF directory as part of my build, and in services.xml added the  
parameter useOriginalwsdl=true.


Now I get this obscure fault when invoking the method that I can't  
figure out. How do I determine why I'm getting an  
IllegalArgumentException with no other changes? I have full DEBUG  
level logging enabled but it gives no useful info (to me anyway) :)


thanks,
charles


org.apache.axis2.AxisFault

at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)

	at  
org 
.apache 
.axis2 
.rpc 
.receivers 
.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:161)


	at  
org 
.apache 
.axis2 
.receivers 
.AbstractInOutMessageReceiver 
.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)


	at  
org 
.apache 
.axis2 
.receivers 
.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)


at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)

	at  
org 
.apache 
.axis2 
.transport 
.http 
.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167)


	at  
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:142)


at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

	at  
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
290)


	at  
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)


	at  
org 
.apache 
.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 
233)


	at  
org 
.apache 
.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 
191)


	at  
org 
.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 
128)


	at  
org 
.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 
102)


	at  
org 
.apache 
.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)


	at  
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 
293)


	at  
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 
849)


	at org.apache.coyote.http11.Http11Protocol 
$Http11ConnectionHandler.process(Http11Protocol.java:583)


	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: 
454)


at java.lang.Thread.run(Thread.java:619)

Caused by: java.lang.IllegalArgumentException

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  
org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java: 
194)


	at  
org 
.apache 
.axis2 
.rpc 
.receivers 
.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102)


... 19 more