You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Sameera Jayasoma <sa...@gmail.com> on 2009/12/01 05:47:38 UTC

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

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 <cg...@lhsw.com> 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
>
>


-- 
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)

Posted by Charles Galpin <cg...@lhsw.com>.
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 <cg...@lhsw.com> 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)

Posted by Andreas Veithen <an...@gmail.com>.
On Mon, Jan 25, 2010 at 22:15, Charles Galpin <cg...@lhsw.com> 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.

>
> 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)

Posted by Charles Galpin <cg...@lhsw.com>.
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)

Posted by Andreas Veithen <an...@gmail.com>.
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

On Mon, Jan 25, 2010 at 21:28, Charles Galpin <cg...@lhsw.com> wrote:
> 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 <cg...@lhsw.com> 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:
>>>>
>>>> <parameter name="ServiceTCCL" locked="false">composite</parameter>
>>>>
>>>> Andreas
>>>>
>>>> On Mon, Jan 25, 2010 at 18:22, Charles Galpin <cg...@lhsw.com> 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
>>>>> 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 <cg...@lhsw.com> 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)

Posted by Charles Galpin <cg...@lhsw.com>.
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 <cg...@lhsw.com> 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:
>>> 
>>> <parameter name="ServiceTCCL" locked="false">composite</parameter>
>>> 
>>> Andreas
>>> 
>>> On Mon, Jan 25, 2010 at 18:22, Charles Galpin <cg...@lhsw.com> 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
>>>> 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 <cg...@lhsw.com> 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)

Posted by Andreas Veithen <an...@gmail.com>.
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 <cg...@lhsw.com> 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:
>>
>> <parameter name="ServiceTCCL" locked="false">composite</parameter>
>>
>> Andreas
>>
>> On Mon, Jan 25, 2010 at 18:22, Charles Galpin <cg...@lhsw.com> 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
>>> 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 <cg...@lhsw.com> 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)

Posted by Charles Galpin <cg...@lhsw.com>.
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:
> 
> <parameter name="ServiceTCCL" locked="false">composite</parameter>
> 
> Andreas
> 
> On Mon, Jan 25, 2010 at 18:22, Charles Galpin <cg...@lhsw.com> 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
>> 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 <cg...@lhsw.com> 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)

Posted by Andreas Veithen <an...@gmail.com>.
Try adding the following parameter on the service:

<parameter name="ServiceTCCL" locked="false">composite</parameter>

Andreas

On Mon, Jan 25, 2010 at 18:22, Charles Galpin <cg...@lhsw.com> 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
> 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 <cg...@lhsw.com> 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)

Posted by Charles Galpin <cg...@lhsw.com>.
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 <cg...@lhsw.com> 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)

Posted by Charles Galpin <cg...@lhsw.com>.
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 <cg...@lhsw.com> 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)

Posted by Sameera Jayasoma <sa...@gmail.com>.
Hi Charles

On Tue, Dec 1, 2009 at 11:27 PM, Charles Galpin <cg...@lhsw.com> 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)

Posted by Charles Galpin <cg...@lhsw.com>.
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)

Posted by Sameera Jayasoma <sa...@gmail.com>.
Hi Charles,

On Tue, Dec 1, 2009 at 8:50 PM, Charles Galpin <cg...@lhsw.com> wrote:

> 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
>


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

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 <cg...@lhsw.com> 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
>>
>
>


-- 
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)

Posted by Olindo Pindaro <o....@gmail.com>.
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.


check for these,,

2009/12/1 Charles Galpin <cg...@lhsw.com>

> 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 <cg...@lhsw.com> 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
>>
>
>


-- 
Olindo Pindaro
http://www.linkedin.com/in/olindopindaro
+39 3939455830

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

Posted by "Grimm, Markus" <Gr...@juris.de>.
Hi,

recently I upgraded from Axis 1.4.1 to Axis 1.5.1 and I had the same kind of problem.
I dont' know if all jars in the lib-directory of the aar-File couldn't be loaded but f.e. a jdom.jar or a saxon8.jar wasn't loaded and under Axis2 1.4.1 everything was fine. I had the same problems as Charles just has. So I put all the jars under axis2/WEB-INF/lib that it works.
But I think, that's not the sense ... 

Thanks,
Markus


Von: Charles Galpin [mailto:cgalpin@lhsw.com] 
Gesendet: Dienstag, 1. Dezember 2009 16:21
An: axis-user@ws.apache.org
Betreff: Re: archive lib directory and 3rd party libraries (axis2/tomcat 6)

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 <cg...@lhsw.com> 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)

Posted by Charles Galpin <cg...@lhsw.com>.
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 <cg...@lhsw.com> 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