jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian_Wei...@sonynetservices.com
Subject Cactus-Bug?
Date Wed, 30 Jul 2003 06:55:14 GMT
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.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: java.lang.NoClassDefFoundError: 
com/.../.../common/interfaces/InvalidUserException 

Thanks for every useful comment,
Chris.



Mime
View raw message