Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Tomcat 5.5/Axis 1.4 java.lang.reflect.InvocationTargetException

    6 answers - 2852 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    none of the logs mention it?
    I realize Tomcat does seem a bit bereft of info in the logs sometime. Would it have been a case where it printed to the system console instead? Mine does that sometimes, instead of (or in addition to) the log(s) and I troubleshoot it that way.
    Message
    From: Luis Rivera [mailto:luiggiilca (AT) gmail (DOT) com]
    Sent: Tuesday, July 18, 2006 5:00 PM
    To: Tomcat Users List
    Subject: Re: Tomcat 5.5/Axis 1.4
    Hi Shankar,
    Thanks a lot. I found my problem. It turned out not to be a Classloader
    problem, but a NullPointer (THANKS T TIM FR THE HINT :) ) problem in the
    server, which I had not found because I don't know how to debug my
    application in Tomcat and there is no single log in the Tomcat directory
    that can give me a clue of what's happening.
    Anyway, the configuration worked as I had it initially:
    1) Dropping the axis.jar in the WEB-INF/lib as you pointed out.
    2) Stubs/Skeletons and all that had nothing to do with the JNI in
    axis/WEB-INF/classes
    3) The classes for the JNI interface/loading the jni library under
    shared/classes
    I think if I can find a way to debug our application in the server, we could
    get better light on what is happening and solve problems a lot quicker :|.
    It's like driving blind right now :|.
    Anybody knows how to debug remotely axis/tomcat apps?
    R.
    7/18/06, Shankar Unni <shankarunni (AT) netscape (DOT) netwrote:
    Luis Rivera wrote:
    I have a web service which will JNI to access the application, which
    according to the documentation should be placed in the shared/classes
    directory. I did so and I got a dreaded
    , which I believe is a class
    loader problem.
    You need to put the Axis jar in the WEB-INF/lib of your webapp. It
    wasn't clear in the original message whether you'd done it like this.
    That's because the common classloader is the *parent* of your webapp's
    classloader, and thus can't see any classes that are in your webapp. So
    you can't put the Axis library there.
    Note: only axis.jar itself really needs to go into the webapp's
    WEB-INF/lib. The rest of the Axis jars (saaj.jar, etc.) can go into
    common/lib, if you have many webapps in the same Tomcat instance that
    use Axis.
    --
    To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
    --
    To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
  • No.1 | | 6119 bytes | |

    Hi Barry and Tomcat/users/devs,

    I am hoping an axis/tomcat/dev/user will have a good advise. I am sure more
    than one user has needed to use axis/tomcat and a JNI interface, so I am
    sure this has been done. I need classes in the shared context and classes in
    the webapps context, which cause serialization/desearialization problems
    when making calls among classes between the two contexts.

    I write the questions here, in case a reader don't want to go through the
    whole explanation below them.

    Q1) As long as I do not referece the classes, which I believe means the
    classes are not loaded, then there is not problem. When they are accessed,
    then it fails. The classes are in both common, shared and webapps, where
    else I am supposed to place them?

    Q2) How do I turn on Logging at the debug level in Tomcat, or any kind of
    meaningful logging to figure out what is happening?

    Q3) Is there a way to enable remote debugging using Eclipse? I read that
    it is possible, but is there any configuration in Tomcat I need to change
    and does it include setting a port for it?

    I found the log that has the stdout, which was showing a couple of
    exceptions, which I solved by placing the appropriate jar files in the right
    place. However, the problem didn't go away, there is something in the Tomcat
    servlet or axis (I don't know) that is handling an exception in the server
    side, because I have a try {} catch () {} where the problem ocurrs and I
    don't catch anything, but the exception is returned to the client. Now not
    even an exception is thrown to the stdout or staderr files.

    The problems comes when in the shared/classes files I access the parameters
    that use the classes generated by the WSDL2java tool. Those classes are in
    both

    TMCAT_HME/shared/classes

    and

    I also dropped the axis jar files in

    TMCAT_HME/shared/lib
    TMCAT_HME/webapp/WEB-INF/lib

    but I still have a problem. At this point it would be nice to at leasts see
    the DEBUG output from Tomcat, but I am not sure how to do that or if it is
    something related to axis. To make this more explicit, this example works:

    class CRLStub

    public void getCompay(CompanyHolder company, StringHolder result)
    throws java.rmi.RemoteException
    {
    company.value = new soap.xsd.CompanyInfo();
    company.value.setCompany("Something");

    result.value = "ok";
    }

    Now, if I try to do the following, there is no error, but obviously, the
    result is not the same

    class CRLStub

    public void getCompay(CompanyInfoHolder company, StringHolder result)
    throws java.rmi.RemoteException
    {
    jnInSharedContext.getCompany(company, result);
    }

    class JNIcrlInSharedContext

    public void getCompany(CompanyInfoHolder company, StringHolder result)
    {
    /// No problem as long as I don't access neither company or result
    }

    But if I do this, then I receive the
    at the client side, even if I
    try to catch the exception with a try {} catch () {} pair.

    public void getCompany(CompanyInfoHolder company, StringHolder result)
    {
    company.value = new soap.xsd.CompanyInfo();
    }
    I would appreciate any kind of hint,
    Thanks in advance,
    R.

    7/18/06, Propes, Barry L <barry.l.propes (AT) citigroup (DOT) comwrote:

    none of the logs mention it?
    I realize Tomcat does seem a bit bereft of info in the logs sometime.
    Would it have been a case where it printed to the system console instead?
    Mine does that sometimes, instead of (or in addition to) the log(s) and I
    troubleshoot it that way.

    Message
    From: Luis Rivera [mailto:luiggiilca (AT) gmail (DOT) com]
    Sent: Tuesday, July 18, 2006 5:00 PM
    To: Tomcat Users List
    Subject: Re: Tomcat 5.5/Axis 1.4

    --
    Hi Shankar,

    Thanks a lot. I found my problem. It turned out not to be a Classloader
    problem, but a NullPointer (THANKS T TIM FR THE HINT :) ) problem in the
    server, which I had not found because I don't know how to debug my
    application in Tomcat and there is no single log in the Tomcat directory
    that can give me a clue of what's happening.

    Anyway, the configuration worked as I had it initially:

    1) Dropping the axis.jar in the WEB-INF/lib as you pointed out.

    2) Stubs/Skeletons and all that had nothing to do with the JNI in
    axis/WEB-INF/classes

    3) The classes for the JNI interface/loading the jni library under
    shared/classes

    I think if I can find a way to debug our application in the server, we
    could
    get better light on what is happening and solve problems a lot quicker :|.
    It's like driving blind right now :|.

    Anybody knows how to debug remotely axis/tomcat apps?

    R.

    7/18/06, Shankar Unni <shankarunni (AT) netscape (DOT) netwrote:

    Luis Rivera wrote:

    I have a web service which will JNI to access the application, which
    according to the documentation should be placed in the shared/classes
    directory. I did so and I got a dreaded
    , which I believe is a
    class
    loader problem.

    You need to put the Axis jar in the WEB-INF/lib of your webapp. It
    wasn't clear in the original message whether you'd done it like this.

    That's because the common classloader is the *parent* of your webapp's
    classloader, and thus can't see any classes that are in your webapp. So
    you can't put the Axis library there.

    Note: only axis.jar itself really needs to go into the webapp's
    WEB-INF/lib. The rest of the Axis jars (saaj.jar, etc.) can go into
    common/lib, if you have many webapps in the same Tomcat instance that
    use Axis.
    --

    To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
    >
    >
    >
  • No.2 | | 751 bytes | |

    I've been using Resin, but I'm switching to Tomcat and am having
    problems configuring Joram. My old Resin configuration was:

    <jndi-link>
    <jndi-name>java:comp/env/jms</jndi-name>
    <jndi-factory></jndi-
    factory>
    <init-param java.naming.factory.host="localhost"/>
    <init-param >
    </jndi-link>

    I can't find any good documentation for a Joram- Tomcat configuration.

    Any help would be appreciated.

    Barrie Selack

    To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
  • No.3 | | 1041 bytes | |

    When starting a new thread (ie sending a message to the list about a
    new topic) please do not reply to an existing message and change the
    subject line. To many of the list archiving services and mail clients
    used by list subscribers this makes your new message appear as part
    of the old thread. This makes it harder for other users to find
    relevant information when searching the lists.

    This is known as thread hijacking and is behaviour that is frowned
    upon on this list. Frequent offenders will be removed from the list.
    It should also be noted that many list subscribers automatically
    ignore any messages that hijack another thread.

    The correct procedure is to create a new message with a new subject.
    This will start a new thread.

    Mark
    tomcat-user-owner

    To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
  • No.4 | | 8307 bytes | |

    Q1) As long as I do not referece the classes, which I believe means the
    classes are not loaded, then there is not problem. When they are accessed,
    then it fails. The classes are in both common, shared and webapps, where
    else I am supposed to place them?

    First, read the classloader howto on the tomcat website
    (). Then
    pick NE and eliminate the others. If the classes are used only on one
    webapp or access other classes within the webapp itself, place them in
    WEB-INF/lib or WEB-INF/classes. Move up to shared or common only if the
    classes are used by several webapps or the engine itself. Placing
    pooled database connection drivers in common/lib is a perfect example of
    classes accessed by the tomcat engine and the webapp.

    Q2) How do I turn on Logging at the debug level in Tomcat, or any kind of
    meaningful logging to figure out what is happening?

    See the tomcat website for your version of tomcat.

    Luis Rivera wrote:

    Hi Barry and Tomcat/users/devs,

    I am hoping an axis/tomcat/dev/user will have a good advise. I am sure
    more
    than one user has needed to use axis/tomcat and a JNI interface, so I am
    sure this has been done. I need classes in the shared context and
    classes in
    the webapps context, which cause serialization/desearialization problems
    when making calls among classes between the two contexts.

    I write the questions here, in case a reader don't want to go through the
    whole explanation below them.

    Q1) As long as I do not referece the classes, which I believe means the
    classes are not loaded, then there is not problem. When they are
    accessed,
    then it fails. The classes are in both common, shared and webapps, where
    else I am supposed to place them?

    Q2) How do I turn on Logging at the debug level in Tomcat, or any kind of
    meaningful logging to figure out what is happening?

    Q3) Is there a way to enable remote debugging using Eclipse? I
    read that
    it is possible, but is there any configuration in Tomcat I need to change
    and does it include setting a port for it?

    I found the log that has the stdout, which was showing a couple of
    exceptions, which I solved by placing the appropriate jar files in the
    right
    place. However, the problem didn't go away, there is something in the
    Tomcat
    servlet or axis (I don't know) that is handling an exception in the
    server
    side, because I have a try {} catch () {} where the problem ocurrs and I
    don't catch anything, but the exception is returned to the client. Now
    not
    even an exception is thrown to the stdout or staderr files.

    The problems comes when in the shared/classes files I access the
    parameters
    that use the classes generated by the WSDL2java tool. Those classes
    are in
    both

    TMCAT_HME/shared/classes

    and

    I also dropped the axis jar files in

    TMCAT_HME/shared/lib
    TMCAT_HME/webapp/WEB-INF/lib

    but I still have a problem. At this point it would be nice to at
    leasts see
    the DEBUG output from Tomcat, but I am not sure how to do that or if
    it is
    something related to axis. To make this more explicit, this example
    works:

    class CRLStub

    public void getCompay(CompanyHolder company, StringHolder result)
    throws java.rmi.RemoteException
    {
    company.value = new soap.xsd.CompanyInfo();
    company.value.setCompany("Something");

    result.value = "ok";
    }

    Now, if I try to do the following, there is no error, but obviously, the
    result is not the same

    class CRLStub

    public void getCompay(CompanyInfoHolder company, StringHolder result)
    throws java.rmi.RemoteException
    {
    jnInSharedContext.getCompany(company, result);
    }

    class JNIcrlInSharedContext

    public void getCompany(CompanyInfoHolder company, StringHolder result)
    {
    /// No problem as long as I don't access neither company or result
    }

    But if I do this, then I receive the
    at the client side, even if I
    try to catch the exception with a try {} catch () {} pair.

    public void getCompany(CompanyInfoHolder company, StringHolder result)
    {
    company.value = new soap.xsd.CompanyInfo();
    }
    I would appreciate any kind of hint,
    Thanks in advance,
    R.

    7/18/06, Propes, Barry L <barry.l.propes (AT) citigroup (DOT) comwrote:
    >
    >>

    >none of the logs mention it?
    >I realize Tomcat does seem a bit bereft of info in the logs sometime.
    >Would it have been a case where it printed to the system console
    >instead?
    >Mine does that sometimes, instead of (or in addition to) the log(s)
    >and I
    >troubleshoot it that way.
    >>

    >Message
    >From: Luis Rivera [mailto:luiggiilca (AT) gmail (DOT) com]
    >Sent: Tuesday, July 18, 2006 5:00 PM
    >To: Tomcat Users List
    >Subject: Re: Tomcat 5.5/Axis 1.4
    >
    >>
    >>

    >Hi Shankar,
    >>

    >Thanks a lot. I found my problem. It turned out not to be a Classloader
    >problem, but a NullPointer (THANKS T TIM FR THE HINT :) ) problem
    >in the
    >server, which I had not found because I don't know how to debug my
    >application in Tomcat and there is no single log in the Tomcat directory
    >that can give me a clue of what's happening.
    >>

    >Anyway, the configuration worked as I had it initially:
    >>

    >1) Dropping the axis.jar in the WEB-INF/lib as you pointed out.
    >>

    >2) Stubs/Skeletons and all that had nothing to do with the JNI in
    >axis/WEB-INF/classes
    >>

    >3) The classes for the JNI interface/loading the jni library under
    >shared/classes
    >>

    >I think if I can find a way to debug our application in the server, we
    >could
    >get better light on what is happening and solve problems a lot
    >quicker :|.
    >It's like driving blind right now :|.
    >>

    >Anybody knows how to debug remotely axis/tomcat apps?
    >>

    >R.
    >>

    >7/18/06, Shankar Unni <shankarunni (AT) netscape (DOT) netwrote:
    >>

    >Luis Rivera wrote:
    >>

    >I have a web service which will JNI to access the application, which
    >according to the documentation should be placed in the
    >shared/classes
    >directory. I did so and I got a dreaded
    >, which I believe is a
    >class
    >loader problem.
    >>

    >You need to put the Axis jar in the WEB-INF/lib of your webapp. It
    >wasn't clear in the original message whether you'd done it like this.
    >>

    >That's because the common classloader is the *parent* of your webapp's
    >classloader, and thus can't see any classes that are in your
    >webapp. So
    >you can't put the Axis library there.
    >>

    >Note: only axis.jar itself really needs to go into the webapp's
    >WEB-INF/lib. The rest of the Axis jars (saaj.jar, etc.) can go into
    >common/lib, if you have many webapps in the same Tomcat instance that
    >use Axis.
    >>
    >>

    >
    >To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    >To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
    >>
    >>
    >>

    >


    To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
  • No.5 | | 9927 bytes | |

    Hi David and tomcat users/devs,

    First of all, thanks for the reply, I really appreicate it. Here are my
    comments to your comments, hopefully you could find out something I did
    miss.

    7/20/06, David Smith <dns4 (AT) cornell (DOT) eduwrote:

    Q1) As long as I do not referece the classes, which I believe means the
    classes are not loaded, then there is not problem. When they are accessed,
    then it fails. The classes are in both common, shared and webapps, where
    else I am supposed to place them?

    First, read the classloader howto on the tomcat website
    (). Then
    pick NE and eliminate the others. If the classes are used only on one
    webapp or access other classes within the webapp itself, place them in
    WEB-INF/lib or WEB-INF/classes. Move up to shared or common only if the
    classes are used by several webapps or the engine itself. Placing
    pooled database connection drivers in common/lib is a perfect example of
    classes accessed by the tomcat engine and the webapp.

    I had read that page before, more than once. The reason I am splitting the
    classes in two locations is because I need to use the JNI, which requires
    the classes to be in the shared pool. Here is where the problem lies,
    because everythinig works if I constrain my application to
    webapps/axisWEB-INF/classes and webapps/axis/WEB-INF/lib.

    The problem comes at run time, when the classes in the shared/classes
    directory access the parameters, which are classes generated from the WSDL
    file. I tried copying the classes to the shared/classes directory, I also
    copied axis.jar to the shared/lib directory and no change. There is
    something in Tomcat obviously tryiing to access something when
    deserializing/serializing and is not finding it.

    Any ideas of what it can be and how I could find out?

    Q2) How do I turn on Logging at the debug level in Tomcat, or any kind of
    meaningful logging to figure out what is happening?

    See the tomcat website for your version of tomcat.

    The Tomcat website wasn't exactly helpful on this. I found another website
    with the exact example I needed to activate logging for catalina. But
    still there are no errors reported, only the DEBUG and INF levels throw
    something out. I still need to activate logging in the webapps classloader
    to see if I can figure out something else.

    Thanks in advance,
    R.

    Luis Rivera wrote:

    Hi Barry and Tomcat/users/devs,

    I am hoping an axis/tomcat/dev/user will have a good advise. I am sure
    more
    than one user has needed to use axis/tomcat and a JNI interface, so I am
    sure this has been done. I need classes in the shared context and
    classes in
    the webapps context, which cause serialization/desearialization problems
    when making calls among classes between the two contexts.

    I write the questions here, in case a reader don't want to go through
    the
    whole explanation below them.

    Q1) As long as I do not referece the classes, which I believe means the
    classes are not loaded, then there is not problem. When they are
    accessed,
    then it fails. The classes are in both common, shared and webapps, where
    else I am supposed to place them?

    Q2) How do I turn on Logging at the debug level in Tomcat, or any kind
    of
    meaningful logging to figure out what is happening?

    Q3) Is there a way to enable remote debugging using Eclipse? I
    read that
    it is possible, but is there any configuration in Tomcat I need to
    change
    and does it include setting a port for it?

    I found the log that has the stdout, which was showing a couple of
    exceptions, which I solved by placing the appropriate jar files in the
    right
    place. However, the problem didn't go away, there is something in the
    Tomcat
    servlet or axis (I don't know) that is handling an exception in the
    server
    side, because I have a try {} catch () {} where the problem ocurrs and I
    don't catch anything, but the exception is returned to the client. Now
    not
    even an exception is thrown to the stdout or staderr files.

    The problems comes when in the shared/classes files I access the
    parameters
    that use the classes generated by the WSDL2java tool. Those classes
    are in
    both

    TMCAT_HME/shared/classes

    and

    I also dropped the axis jar files in

    TMCAT_HME/shared/lib
    TMCAT_HME/webapp/WEB-INF/lib

    but I still have a problem. At this point it would be nice to at
    leasts see
    the DEBUG output from Tomcat, but I am not sure how to do that or if
    it is
    something related to axis. To make this more explicit, this example
    works:

    class CRLStub

    public void getCompay(CompanyHolder company, StringHolder result)
    throws java.rmi.RemoteException
    {
    company.value = new soap.xsd.CompanyInfo();
    company.value.setCompany("Something");

    result.value = "ok";
    }

    Now, if I try to do the following, there is no error, but obviously, the
    result is not the same

    class CRLStub

    public void getCompay(CompanyInfoHolder company, StringHolder result)
    throws java.rmi.RemoteException
    {
    jnInSharedContext.getCompany(company, result);
    }

    class JNIcrlInSharedContext

    public void getCompany(CompanyInfoHolder company, StringHolder result)
    {
    /// No problem as long as I don't access neither company or result
    }

    But if I do this, then I receive the
    at the client side, even if
    I
    try to catch the exception with a try {} catch () {} pair.

    public void getCompany(CompanyInfoHolder company, StringHolder result)
    {
    company.value = new soap.xsd.CompanyInfo();
    }
    I would appreciate any kind of hint,
    Thanks in advance,
    R.

    7/18/06, Propes, Barry L <barry.l.propes (AT) citigroup (DOT) comwrote:
    >
    >>

    >none of the logs mention it?
    >I realize Tomcat does seem a bit bereft of info in the logs sometime.
    >Would it have been a case where it printed to the system console
    >instead?
    >Mine does that sometimes, instead of (or in addition to) the log(s)
    >and I
    >troubleshoot it that way.
    >>

    >Message
    >From: Luis Rivera [mailto:luiggiilca (AT) gmail (DOT) com]
    >Sent: Tuesday, July 18, 2006 5:00 PM
    >To: Tomcat Users List
    >Subject: Re: Tomcat 5.5/Axis 1.4
    >
    >>
    >>

    >Hi Shankar,
    >>

    >Thanks a lot. I found my problem. It turned out not to be a Classloader
    >problem, but a NullPointer (THANKS T TIM FR THE HINT :) ) problem
    >in the
    >server, which I had not found because I don't know how to debug my
    >application in Tomcat and there is no single log in the Tomcat

    directory
    >that can give me a clue of what's happening.
    >>

    >Anyway, the configuration worked as I had it initially:
    >>

    >1) Dropping the axis.jar in the WEB-INF/lib as you pointed out.
    >>

    >2) Stubs/Skeletons and all that had nothing to do with the JNI in
    >axis/WEB-INF/classes
    >>

    >3) The classes for the JNI interface/loading the jni library under
    >shared/classes
    >>

    >I think if I can find a way to debug our application in the server, we
    >could
    >get better light on what is happening and solve problems a lot
    >quicker :|.
    >It's like driving blind right now :|.
    >>

    >Anybody knows how to debug remotely axis/tomcat apps?
    >>

    >R.
    >>

    >7/18/06, Shankar Unni <shankarunni (AT) netscape (DOT) netwrote:
    >>

    >Luis Rivera wrote:
    >>

    >I have a web service which will JNI to access the application,

    which
    >according to the documentation should be placed in the
    >shared/classes
    >directory. I did so and I got a dreaded
    >, which I believe is a
    >class
    >loader problem.
    >>

    >You need to put the Axis jar in the WEB-INF/lib of your webapp. It
    >wasn't clear in the original message whether you'd done it like this.
    >>

    >That's because the common classloader is the *parent* of your

    webapp's
    >classloader, and thus can't see any classes that are in your
    >webapp. So
    >you can't put the Axis library there.
    >>

    >Note: only axis.jar itself really needs to go into the webapp's
    >WEB-INF/lib. The rest of the Axis jars (saaj.jar, etc.) can go into
    >common/lib, if you have many webapps in the same Tomcat instance that
    >use Axis.
    >>
    >>

    >
    >To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    >To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
    >>
    >>
    >>

    >
    >
    >


    To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
    --
  • No.6 | | 12937 bytes | |

    Hi,

    Well, I managed to hook the logger into the catalina and webapps directories
    and have two different streams of output. activating the DEBUG level I
    managed to get something useful. I also used FileMon to find out which files
    were not found and even after getting rid of those errors (by placing the
    correct class files in the right places), the same error is thrown at the
    client.

    Now, this is the full stack trace at the Server when the CompanyInfo class
    is accessed by the class in the shared/classes directory:

    27782 [http-8095-Processor25] DEBUG org.apache.axis.enterprise - Mapping
    Exception to AxisFault^M
    ^M
    at (Native Method)^M
    at (
    )^M
    at (
    )^M
    at (Method.java:585)^M
    at (
    RPCProvider.java:397)^M
    at (
    RPCProvider.java:186)^M
    at (
    JavaProvider.java:323)^M
    at (
    InvocationStrategy.java:32)^M
    at (SimpleChain.java:118)^M
    at (SimpleChain.java:83)^M
    at (SAPService.java
    :454)^M
    at (AxisServer.java:281)^M
    at (
    AxisServlet.java:699)^M
    at (HttpServlet.java:709)^M
    at (
    AxisServletBase.java:327)^M
    at (HttpServlet.java:802)^M
    at (
    )^M
    at (
    )^M
    at (
    StandardWrapperValve.java:213)^M
    at (
    StandardContextValve.java:178)^M
    at (
    StandardHostValve.java:126)^M
    at (
    ErrorReportValve.java:105)^M
    at (
    StandardEngineValve.java:107)^M
    at (
    CoyoteAdapter.java:148)^M
    at (
    Http11Processor.java:869)^M
    at
    $
    (Http11BaseProtocol.java:664)^M
    at (
    PoolTcpEndpoint.java:527)^M
    at (
    )^M
    at $ControlRunnable.run(
    ThreadPool.java:684)^M
    at java.lang.Thread.run(Thread.java:595)^M
    Caused by: java.lang.LinkageError: Class soap/xsd/CompanyInfo violates
    loader constraints^M
    at (Native Method)^M
    at (ClassLoader.java:620)^M
    at (
    SecureClassLoader.java:124)^M
    at (URLClassLoader.java:260)^M
    at java.net.URLClassLoader.access$100(URLClassLoader. java:56)^M
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)^M
    at (Native Method)^M
    at (URLClassLoader.java:188)^M
    at (ClassLoader.java:306)^M
    at (ClassLoader.java:251)^M
    at (ClassLoader.java:319)^M
    at vsa.jniCRLimpl.nada(jniCRLimpl.java:100)^M
    at soap.wsdl.CRLImpl.getCompany(CRLImpl.java:94)^M
    at (Unknown Source)^M
    30 more^M

    As you will see, it seems to be a problem in the catalina.policy file, or
    whichever file is setting the policy for what each classloader is allowed to
    use. Does anybody have a working example or has any idea of what could be
    added or modified in the policy file to make this work.

    Thanks in advance,
    R.

    7/20/06, Luis Rivera <luiggiilca (AT) gmail (DOT) comwrote:
    --
    Hi David and tomcat users/devs,

    First of all, thanks for the reply, I really appreicate it. Here are my
    comments to your comments, hopefully you could find out something I did
    miss.

    7/20/06, David Smith <dns4 (AT) cornell (DOT) eduwrote:

    Q1) As long as I do not referece the classes, which I believe means the
    classes are not loaded, then there is not problem. When they are
    accessed,
    then it fails. The classes are in both common, shared and webapps, where

    else I am supposed to place them?

    First, read the classloader howto on the tomcat website
    (
    ). Then
    pick NE and eliminate the others. If the classes are used only on one
    webapp or access other classes within the webapp itself, place them in
    WEB-INF/lib or WEB-INF/classes. Move up to shared or common only if the

    classes are used by several webapps or the engine itself. Placing
    pooled database connection drivers in common/lib is a perfect example of
    classes accessed by the tomcat engine and the webapp.
    --
    I had read that page before, more than once. The reason I am splitting
    the classes in two locations is because I need to use the JNI, which
    requires the classes to be in the shared pool. Here is where the problem
    lies, because everythinig works if I constrain my application to
    webapps/axisWEB-INF/classes and webapps/axis/WEB-INF/lib.

    The problem comes at run time, when the classes in the shared/classes
    directory access the parameters, which are classes generated from the WSDL
    file. I tried copying the classes to the shared/classes directory, I also
    copied axis.jar to the shared/lib directory and no change. There is
    something in Tomcat obviously tryiing to access something when
    deserializing/serializing and is not finding it.

    Any ideas of what it can be and how I could find out?

    Q2) How do I turn on Logging at the debug level in Tomcat, or any kind of
    meaningful logging to figure out what is happening?

    See the tomcat website for your version of tomcat.
    --
    The Tomcat website wasn't exactly helpful on this. I found another website
    with the exact example I needed to activate logging for catalina. But
    still there are no errors reported, only the DEBUG and INF levels throw
    something out. I still need to activate logging in the webapps classloader
    to see if I can figure out something else.
    --
    Thanks in advance,
    R.

    Luis Rivera wrote:

    Hi Barry and Tomcat/users/devs,

    I am hoping an axis/tomcat/dev/user will have a good advise. I am sure
    more
    than one user has needed to use axis/tomcat and a JNI interface, so I
    am
    sure this has been done. I need classes in the shared context and
    classes in
    the webapps context, which cause serialization/desearialization
    problems
    when making calls among classes between the two contexts.

    I write the questions here, in case a reader don't want to go through
    the
    whole explanation below them.

    Q1) As long as I do not referece the classes, which I believe means
    the
    classes are not loaded, then there is not problem. When they are
    accessed,
    then it fails. The classes are in both common, shared and webapps,
    where
    else I am supposed to place them?

    Q2) How do I turn on Logging at the debug level in Tomcat, or any kind
    of
    meaningful logging to figure out what is happening?

    Q3) Is there a way to enable remote debugging using Eclipse? I
    read that
    it is possible, but is there any configuration in Tomcat I need to
    change
    and does it include setting a port for it?

    I found the log that has the stdout, which was showing a couple of
    exceptions, which I solved by placing the appropriate jar files in the
    right
    place. However, the problem didn't go away, there is something in the
    Tomcat
    servlet or axis (I don't know) that is handling an exception in the
    server
    side, because I have a try {} catch () {} where the problem ocurrs and
    I
    don't catch anything, but the exception is returned to the client. Now
    not
    even an exception is thrown to the stdout or staderr files.

    The problems comes when in the shared/classes files I access the
    parameters
    that use the classes generated by the WSDL2java tool. Those classes
    are in
    both

    TMCAT_HME/shared/classes

    and

    I also dropped the axis jar files in

    TMCAT_HME/shared/lib
    TMCAT_HME/webapp/WEB-INF/lib

    but I still have a problem. At this point it would be nice to at
    leasts see
    the DEBUG output from Tomcat, but I am not sure how to do that or if
    it is
    something related to axis. To make this more explicit, this example
    works:

    class CRLStub

    public void getCompay(CompanyHolder company, StringHolder result)
    throws java.rmi.RemoteException
    {
    company.value = new soap.xsd.CompanyInfo();
    company.value.setCompany("Something");

    result.value = "ok";
    }

    Now, if I try to do the following, there is no error, but obviously,
    the
    result is not the same

    class CRLStub

    public void getCompay(CompanyInfoHolder company, StringHolder result)
    throws java.rmi.RemoteException
    {
    jnInSharedContext.getCompany (company, result);
    }

    class JNIcrlInSharedContext

    public void getCompany(CompanyInfoHolder company, StringHolder result)
    {
    /// No problem as long as I don't access neither company or result
    }

    But if I do this, then I receive the
    at the client side, even
    if I
    try to catch the exception with a try {} catch () {} pair.

    public void getCompany(CompanyInfoHolder company, StringHolder result)
    {
    company.value = new soap.xsd.CompanyInfo();
    }
    I would appreciate any kind of hint,
    Thanks in advance,
    R.

    7/18/06, Propes, Barry L <barry.l.propes (AT) citigroup (DOT) comwrote:
    >
    >>

    >none of the logs mention it?
    >I realize Tomcat does seem a bit bereft of info in the logs sometime.
    >Would it have been a case where it printed to the system console
    >instead?
    >Mine does that sometimes, instead of (or in addition to) the log(s)
    >and I
    >troubleshoot it that way.
    >>

    >Message
    >From: Luis Rivera [mailto:luiggiilca (AT) gmail (DOT) com]
    >Sent: Tuesday, July 18, 2006 5:00 PM
    >To: Tomcat Users List
    >Subject: Re: Tomcat 5.5/Axis 1.4
    >
    >>
    >>

    >Hi Shankar,
    >>

    >Thanks a lot. I found my problem. It turned out not to be a

    Classloader
    >problem, but a NullPointer (THANKS T TIM FR THE HINT :) ) problem
    >in the
    >server, which I had not found because I don't know how to debug my
    >application in Tomcat and there is no single log in the Tomcat

    directory
    >that can give me a clue of what's happening.
    >>

    >Anyway, the configuration worked as I had it initially:
    >>

    >1) Dropping the axis.jar in the WEB-INF/lib as you pointed out.
    >>

    >2) Stubs/Skeletons and all that had nothing to do with the JNI in
    >axis/WEB-INF/classes
    >>

    >3) The classes for the JNI interface/loading the jni library under
    >shared/classes
    >>

    >I think if I can find a way to debug our application in the server,

    we
    >could
    >get better light on what is happening and solve problems a lot
    >quicker :|.
    >It's like driving blind right now :|.
    >>

    >Anybody knows how to debug remotely axis/tomcat apps?
    >>

    >R.
    >>

    >7/18/06, Shankar Unni <shankarunni (AT) netscape (DOT) net wrote:
    >>

    >Luis Rivera wrote:
    >>

    >I have a web service which will JNI to access the application,

    which
    >according to the documentation should be placed in the
    >shared/classes
    >directory. I did so and I got a dreaded
    >, which I believe is a
    >class
    >loader problem.
    >>

    >You need to put the Axis jar in the WEB-INF/lib of your webapp. It
    >wasn't clear in the original message whether you'd done it like

    this.
    >>

    >That's because the common classloader is the *parent* of your

    webapp's
    >classloader, and thus can't see any classes that are in your
    >webapp. So
    >you can't put the Axis library there.
    >>

    >Note: only axis.jar itself really needs to go into the webapp's
    >WEB-INF/lib. The rest of the Axis jars (saaj.jar, etc.) can go into
    >common/lib, if you have many webapps in the same Tomcat instance

    that
    >use Axis.
    >>
    >>
    >>


    >To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    >To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    >For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
    >>
    >>
    >>

    >
    >
    >


    To start a new topic, e-mail: users (AT) tomcat (DOT) apache.org
    To unsubscribe, e-mail: users-unsubscribe (AT) tomcat (DOT) apache.org
    For additional commands, e-mail: users-help (AT) tomcat (DOT) apache.org
    >
    >
    >

Re: Tomcat 5.5/Axis 1.4 java.lang.reflect.InvocationTargetException


max 4000 letters.
Your nickname that display:
In order to stop the spam: 6 + 5 =
QUESTION ON "Java"

EMSDN.COM