• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can't using weblogic's datapool in Tomcat?

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to Tomcat forum.
bear
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic