With more testing, the behavior is (when I only have derby-10.1.1.0.jar as the dependency)
1) start the server 2) deploy the datasource + simple app 3) access it via web page. Worked fine. 4) undeploy the datasource + simple app 5) repeat step 2. and 3. Got the same NPE again. 6) restart the server. Access the web page. Worked fine. This is better than what I had initially. Seems that the undeploy datasource didn't work cleanly and still have Derby embedded driver loaded? Lin -----Original Message----- From: Lin Sun [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 06, 2006 11:14 PM To: '[email protected]' Subject: RE: unable to run a simple jsp application Hi Stan, You are right, the classloader in 1.1 seems to change a lot. So I went back to the datasource plan, and I had the following as dependencies: <dep:dependency> <dep:groupId>org.apache.derby</dep:groupId> <dep:artifactId>derby</dep:artifactId> <dep:version>10.1.1.0</dep:version> <dep:type>jar</dep:type> </dep:dependency> <dep:dependency> <dep:groupId>org.apache.derby</dep:groupId> <dep:artifactId>derbynet</dep:artifactId> <dep:version>10.1.1.0</dep:version> <dep:type>jar</dep:type> </dep:dependency> First I tried to comment out both of them, but I got a " java.lang.NoClassDefFoundError: org/apache/derby/jdbc/EmbeddedXADataSource" from tranql. Then I only commented out the derbynet jar and redeployed everything. Still got the same exception. I looked over the derby datasource section of the daytrader plan, and it didn't have any org.apache.derby dependencies. I don't understand that even though the daytrader uses an application scoped datasource. But I haven't been able to get daytrader running yet. P.S. the jsp is doing basic stuff...it was failing when attempting to get the connection from the pool. Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource ds = (DataSource)envContext.lookup("jdbc/DataSource"); System.out.println("Got DataSource: " +ds.toString() ); con = ds.getConnection(); //failed here. Lin -----Original Message----- From: Stanley Bradbury [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 06, 2006 6:50 PM To: [email protected] Subject: Re: unable to run a simple jsp application Lin Sun wrote: > Hi there, > > I have a simple jsp application that worked on 1.0. It displays the > contents of the EMP table of the Employee database. > I am using the embedded derby database and the > tranql-connector-derby-embed-xa-1.1 rar file in Geronimo 1.1 build > (geronimo-tomcat-j2ee-1.1-410806). > > The server wide datasource and application war file deployed fine. > > However, when I access the jsp from my firefox browser, I got the following > exception > in the console when the server is trying to get the database connection: > == SNIP === Hi Lin - The few times I have seen a NullPointerException while trying to start a Derby database have been caused by the Derby embedded driver being loaded by multiple classloaders in a JVM. Could it be that your JSP is causing the embedded driver to loaded? Isn't it true that the server wide datasource should be starting the database when Geronimo starts rather than this happening when the JSP is called? The fact that this fails with version 1.1 and not 1.0 might be because of classloader changes that were implemented since 1.0. Any thoughts on this theory from people knowledgeable about the the Geronimo 1.1 JSP classloader hierarchy? >>> Derby Start exception: org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:684) at java.lang.Thread.run(Thread.java:568) org.apache.derby.impl.jdbc.EmbedSQLExceptionFailed to start database 'Employee', see the next exception for details. java.lang.NullPointerException at org.apache.jsp.jsp.EMPdemo_jsp._jspService(org.apache.jsp.jsp.EMPdemo _jsp:70)
