• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't using weblogic's datapool in Tomcat?

 
lyo Yashnoo
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to Tomcat forum.
bear
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic