NtlmHttpFilter java.lang.ExceptionInInitializerError & java.lang.NoClassDefFoundError

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

NtlmHttpFilter java.lang.ExceptionInInitializerError & java.lang.NoClassDefFoundError

Sergio Mendonça
Hi,

Im trying to use the NtlmHttpFilter to authenticate the users and have
some problems.
This is the configuration that i'm using in the web.xml:

<filter>
        <filter-name>NtlmHttpFilter</filter-name>
        <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
        <init-param>
            <param-name>jcifs.smb.client.domain</param-name>
            <param-value>celos</param-value>
        </init-param>
        <init-param>
            <param-name>jcifs.netbios.wins</param-name>
            <param-value>192.168.13.230</param-value>
        </init-param>
        <init-param>
            <param-name>jcifs.netbios.cachePolicy</param-name>
            <param-value>0</param-value>
        </init-param>
        <init-param>
            <param-name>jcifs.util.loglevel</param-name>
            <param-value>3</param-value>
        </init-param>
        <init-param>
                <param-name>jcifs.smb.client.username</param-name>
                <param-value>operador</param-value>
        </init-param>
        <init-param>
            <param-name>jcifs.smb.client.password</param-name>
            <param-value>operador2003</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>NtlmHttpFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

This configuration works perfectly in others servers, but in the
production server does'nt work, generating this 2 errors listed below:
*
1-*
ERROR 13/06/2006 13:06:30,656
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cadastro].[default]
- Servlet.service() for servlet default threw exception
 java.lang.ExceptionInInitializerError
    at jcifs.smb.SmbSession.getChallengeForDomain(SmbSession.java:95)
    at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:150)
    at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:114)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
    at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
    at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
    at jcifs.netbios.NbtAddress.<clinit>(NbtAddress.java:199)
    ... 17 more

*2-*
ERROR 13/06/2006 13:06:31,744
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cadastro].[default]
- Servlet.service() for servlet default threw exception
 java.lang.NoClassDefFoundError
    at jcifs.smb.SmbSession.getChallengeForDomain(SmbSession.java:95)
    at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:150)
    at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:114)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
    at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
    at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)

The login dialog is shown, i set the username and password, then the
error #1 occurs.
After this, the error #2 passes to occour.

Somebody can help me?
Thanks

Sergio Mendonça
Reply | Threaded
Open this post in threaded view
|

Re: NtlmHttpFilter java.lang.ExceptionInInitializerError & java.lang.NoClassDefFoundError

Michael B Allen-4
JCIFS does not work if the objects it puts into the session are
serialized. This can happen in a cluster environment or when restarting
a container.

The only solution is to somehow disabled session serialization for
the filter.

There is a fundamental problem with trying to use a stateful
authentication protocol (NTLM) over a stateless transport (HTTP).

Mike

On Wed, 14 Jun 2006 10:07:41 -0300
Sergio Mendonça <[hidden email]> wrote:

> Hi,
>
> Im trying to use the NtlmHttpFilter to authenticate the users and have
> some problems.
> This is the configuration that i'm using in the web.xml:
>
> <filter>
>         <filter-name>NtlmHttpFilter</filter-name>
>         <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
>         <init-param>
>             <param-name>jcifs.smb.client.domain</param-name>
>             <param-value>celos</param-value>
>         </init-param>
>         <init-param>
>             <param-name>jcifs.netbios.wins</param-name>
>             <param-value>192.168.13.230</param-value>
>         </init-param>
>         <init-param>
>             <param-name>jcifs.netbios.cachePolicy</param-name>
>             <param-value>0</param-value>
>         </init-param>
>         <init-param>
>             <param-name>jcifs.util.loglevel</param-name>
>             <param-value>3</param-value>
>         </init-param>
>         <init-param>
>                 <param-name>jcifs.smb.client.username</param-name>
>                 <param-value>operador</param-value>
>         </init-param>
>         <init-param>
>             <param-name>jcifs.smb.client.password</param-name>
>             <param-value>operador2003</param-value>
>         </init-param>
>     </filter>
>     <filter-mapping>
>         <filter-name>NtlmHttpFilter</filter-name>
>         <url-pattern>/*</url-pattern>
>     </filter-mapping>
>
> This configuration works perfectly in others servers, but in the
> production server does'nt work, generating this 2 errors listed below:
> *
> 1-*
> ERROR 13/06/2006 13:06:30,656
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cadastro].[default]
> - Servlet.service() for servlet default threw exception
>  java.lang.ExceptionInInitializerError
>     at jcifs.smb.SmbSession.getChallengeForDomain(SmbSession.java:95)
>     at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:150)
>     at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:114)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>     at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>     at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>     at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>     at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>     at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>     at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>     at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
>     at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
>     at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>     at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>     at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>     at java.lang.Thread.run(Thread.java:595)
> Caused by: java.lang.NullPointerException
>     at jcifs.netbios.NbtAddress.<clinit>(NbtAddress.java:199)
>     ... 17 more
>
> *2-*
> ERROR 13/06/2006 13:06:31,744
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cadastro].[default]
> - Servlet.service() for servlet default threw exception
>  java.lang.NoClassDefFoundError
>     at jcifs.smb.SmbSession.getChallengeForDomain(SmbSession.java:95)
>     at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:150)
>     at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:114)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>     at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>     at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>     at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>     at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>     at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>     at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>     at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
>     at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
>     at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>     at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>     at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>     at java.lang.Thread.run(Thread.java:595)
>
> The login dialog is shown, i set the username and password, then the
> error #1 occurs.
> After this, the error #2 passes to occour.
>
> Somebody can help me?
> Thanks
>
> Sergio Mendonça
>


--
Michael B Allen
PHP Extension for SSO w/ Windows Group Authorization
http://www.ioplex.com/
Reply | Threaded
Open this post in threaded view
|

Re: NtlmHttpFilter java.lang.ExceptionInInitializerError & java.lang.NoClassDefFoundError

Sergio Mendonça
Thanks for your help Mike!

I'm not using a cluster environment and the errors happens when the
tomcat run normally.
In the server that the NtlmHttpFilter works fine the OS is Linux Fedora
Core 4 and in the server that the problems occours, ths OS is Linux
Fedora Core 5.
The two servers are 64 bits.
These are all the informations that i know for now.
How I could disabled session serialization?

Thanks again!
Sergio


Michael B Allen wrote:

>JCIFS does not work if the objects it puts into the session are
>serialized. This can happen in a cluster environment or when restarting
>a container.
>
>The only solution is to somehow disabled session serialization for
>the filter.
>
>There is a fundamental problem with trying to use a stateful
>authentication protocol (NTLM) over a stateless transport (HTTP).
>
>Mike
>
>On Wed, 14 Jun 2006 10:07:41 -0300
>Sergio Mendonça <[hidden email]> wrote:
>
>  
>
>>Hi,
>>
>>Im trying to use the NtlmHttpFilter to authenticate the users and have
>>some problems.
>>This is the configuration that i'm using in the web.xml:
>>
>><filter>
>>        <filter-name>NtlmHttpFilter</filter-name>
>>        <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
>>        <init-param>
>>            <param-name>jcifs.smb.client.domain</param-name>
>>            <param-value>celos</param-value>
>>        </init-param>
>>        <init-param>
>>            <param-name>jcifs.netbios.wins</param-name>
>>            <param-value>192.168.13.230</param-value>
>>        </init-param>
>>        <init-param>
>>            <param-name>jcifs.netbios.cachePolicy</param-name>
>>            <param-value>0</param-value>
>>        </init-param>
>>        <init-param>
>>            <param-name>jcifs.util.loglevel</param-name>
>>            <param-value>3</param-value>
>>        </init-param>
>>        <init-param>
>>                <param-name>jcifs.smb.client.username</param-name>
>>                <param-value>operador</param-value>
>>        </init-param>
>>        <init-param>
>>            <param-name>jcifs.smb.client.password</param-name>
>>            <param-value>operador2003</param-value>
>>        </init-param>
>>    </filter>
>>    <filter-mapping>
>>        <filter-name>NtlmHttpFilter</filter-name>
>>        <url-pattern>/*</url-pattern>
>>    </filter-mapping>
>>
>>This configuration works perfectly in others servers, but in the
>>production server does'nt work, generating this 2 errors listed below:
>>*
>>1-*
>>ERROR 13/06/2006 13:06:30,656
>>org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cadastro].[default]
>>- Servlet.service() for servlet default threw exception
>> java.lang.ExceptionInInitializerError
>>    at jcifs.smb.SmbSession.getChallengeForDomain(SmbSession.java:95)
>>    at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:150)
>>    at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:114)
>>    at
>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>    at
>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>    at
>>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>>    at
>>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>>    at
>>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>>    at
>>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>>    at
>>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>>    at
>>org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>>    at
>>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
>>    at
>>org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
>>    at
>>org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>>    at
>>org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>>    at
>>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>>    at java.lang.Thread.run(Thread.java:595)
>>Caused by: java.lang.NullPointerException
>>    at jcifs.netbios.NbtAddress.<clinit>(NbtAddress.java:199)
>>    ... 17 more
>>
>>*2-*
>>ERROR 13/06/2006 13:06:31,744
>>org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cadastro].[default]
>>- Servlet.service() for servlet default threw exception
>> java.lang.NoClassDefFoundError
>>    at jcifs.smb.SmbSession.getChallengeForDomain(SmbSession.java:95)
>>    at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:150)
>>    at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:114)
>>    at
>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>>    at
>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>>    at
>>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>>    at
>>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>>    at
>>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>>    at
>>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>>    at
>>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>>    at
>>org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>>    at
>>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
>>    at
>>org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
>>    at
>>org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>>    at
>>org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>>    at
>>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>>    at java.lang.Thread.run(Thread.java:595)
>>
>>The login dialog is shown, i set the username and password, then the
>>error #1 occurs.
>>After this, the error #2 passes to occour.
>>
>>Somebody can help me?
>>Thanks
>>
>>Sergio Mendonça
>>
>>    
>>
>
>
>  
>