aspose file tools*
The moose likes Tomcat and the fly likes Can't using weblogic's datapool in Tomcat? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Can Watch "Can New topic
Author

Can't using weblogic's datapool in Tomcat?

lyo Yashnoo
Ranch Hand

Joined: Sep 15, 2003
Posts: 50
Hi everyone:
I deploy a datapool in weblogic8 successfully and I want to using the datapool in Tomcat4.But I can't using the datapool in Tomcat.I already copy the wlclient.jar to the directory "E:\Tomcat4\webapps\lyo\WEB-INF\lib" and I can use the namespace "weblogic.jndi.*".
The JNDI name of the datapool is jdbc/mysql in weblogic and I can see it in weblogic JNDI tree window. My jsp code is:
/////////////////////invokepool.jsp//////////////////////////////////////
String sql="select isbn,bookname,bookprice from cmpbook";
ResultSet rs=null;
Connection conn=null;
Statement stm=null;
try{
Properties pro=new Properties();
pro.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
pro.put(Context.PROVIDER_URL,"t3://localhost:7001");
Context ctx=new InitialContext(pro);
out.println("debug...");
DataSource ds=(DataSource)ctx.lookup("jdbc/mysql");
conn=ds.getConnection();
stm=conn.createStatement();

rs=stm.executeQuery(sql);
}catch(Exception e){
out.println(e.toString());
}
try{
while(rs.next()){
%>
<table bgcolor="red" align="center" border="1">
<tr>
<td>
<%=rs.getString("isbn")%>
</td>
<td>
<%=rs.getString("bookname")%>
</td>
<td>
<%=rs.getString("bookprice")%>
</td>
<%
}
Tomcat report error:"debug... java.rmi.MarshalException: CORBA MARSHAL 0 Maybe; nested exception is: org.omg.CORBA.MARSHAL: vmcid: 0x0 minor code: 0 completed: Maybe java.lang.NullPointerException java.lang.NullPointerException "
But what is the "vmcid"?
I also using the code "DataSource ds=(DataSource)ctx.lookup("java:comp/env/jdbc/mysql");"
But the Tomcat report error:
"debug... javax.naming.NameNotFoundException: Name jdbc is not bound in this Context java.lang.NullPointerException java.lang.NullPointerException "
Then the datapool monitor of weblogic show: connection---1.
It has a connection after I compile the jsp file.But why it can't display?
What's wrong? Thanks :roll:
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61610
    
  67

Moved to Tomcat forum.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't using weblogic's datapool in Tomcat?