You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Vincent Massol <vm...@pivolis.com> on 2003/08/07 10:44:31 UTC

RE: Cactus-Bug?

Hi Christian,

This seems like a setup problem you have. Your test code seems ok.
However, to help you we would need more information:

- how are you starting the cactus tests? Using Ant?
- Are you using the <cactifywar> and <cactus> Ant tasks?
- Can you send us the relevant part of your start script?
- Can you attach your console output with the error?

The error should be easy to fix as it is a NCDFE (i.e. an issue of
classpath).

Thanks
-Vincent

-----Original Message-----
From: Christian_Weiler@sonynetservices.com
[mailto:Christian_Weiler@sonynetservices.com] 
Sent: 30 July 2003 08:55
To: cactus-user@jakarta.apache.org
Subject: Cactus-Bug?


Hi guys! 

I've got the following problem in an EJB TestCase within Weblogic Bea
8.1: 

For code snippet 1) the test works fine and results in No Errors: 
Snippet 1) represents my workaround for a problem I encountered in 1.5
Beta! Obviously my ejb-application finds all the Exception classes while
cactus does not find it in it's classpath! 

1)         
        final public void testAuthenticateMobileId() throws Exception { 
    
        // create a user and check authentication 
        System.out.println("--- Test Authenticate a Mobile User ---"); 
    
        m_id = m_manager.createUser("Scotty", "123456", "StreamMeUp",
"TestService0"); 
        int idAuth = m_manager.authenticateMobile("123456",
"StreamMeUp", "TestService0"); 
        assertEquals("Authentication OK", m_id, idAuth); 
        
        System.out.println("Authenticate with wrong mobile id name
..."); 
        try{ 
            m_manager.authenticate("NotExisting", "StreamMeUp",
"TestService0"); 
            fail("Invalid user not recognised"); 
        // !!ONLY EXCEPTION CAUHGT HERE!! 
        } catch (Exception e) { 
            // work around since i can not access Exception in common
module!? 
            // see @todo 
            assertEquals(e.getClass().getName(), 
            "com.....common.interfaces.InvalidUserException"); 
        } 
        } 


In Snippet 2) the TestCase returns with the appended Classpath problem
message. I also tried to put the appropriate jar file not only in my ear
file but also directly in my cactus-war file with the same result! It
seems that the ServletRedirector must face this exception already in it'
init phase because it does not even come to the first system.out line!
Additionally the last log message I get from the app server is something
like "RedirectorServlet init"!? Does anyone know this problem - or have
a clue what could cause this problem? 

2) 

        final public void testAuthenticateMobileId() throws Exception { 
    
        // create a user and check authentication 
        System.out.println("--- Test Authenticate a Mobile User ---"); 
    
        m_id = m_manager.createUser("Scotty", "123456", "StreamMeUp",
"TestService0"); 
        int idAuth = m_manager.authenticateMobile("123456",
"StreamMeUp", "TestService0"); 
        assertEquals("Authentication OK", m_id, idAuth); 
        
        System.out.println("Authenticate with wrong mobile id name
..."); 
        try{ 
            m_manager.authenticate("NotExisting", "StreamMeUp",
"TestService0"); 
            fail("Invalid user not recognised"); 
        // !!DIFF: InvalidUserException CAUHGT HERE!! 
        } catch (InvalidUserException e) { 
            // work around since i can not access Exception in common
module!? 
            // see @todo 
            assertEquals(e.getClass().getName(), 
           
"com.sonynetservices.pma.common.interfaces.InvalidUserException"); 
        } 
        } 


Junit report message: 
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
Caused by: java.lang.NoClassDefFoundError:
com/.../.../common/interfaces/InvalidUserException 

Thanks for every useful comment, 
Chris.