tomcat 4.0.2
weblogic 6.1

Trying to get the initial context to work correctly when I try to deploy 
the PetStore .war file for tomcat to process, but have all the EJB's for 
WebLogic 6.1 to handle. Has anyone got the combination of tomcat and 
weblogic to work successfully where the weblogic intial context factory 
is used?

I can't seem to get Tomcat to get the \petstore context to use the 
correct settings for the InitialContext so that it uses the WebLogic 
classes. I have tried various permutations of changes to server.xml 
including:

            <DefaultContext>
               <Parameter name="java.naming.factory.initial"
                            value="weblogic.jndi.WLInitialContextFactory"
                            override="false"/>
               <Parameter name="java.naming.provider.url"
                            value="t3://localhost:7001"
                            override="false"/>
               <Parameter name="java.naming.factory.url.pkgs"
                            value="weblogic.jndi.factories"
                            override="false"/>
               <Parameter name="java.naming.security.principal"
                            value="system"
                            override="false"/>
               <Parameter name="java.naming.security.credentials"
                            value="mypassword"
                            override="false"/>
            </DefaultContext>

within server.xml, as well as a <Context> definition that essentially 
tries and sets the same thing as well as defining the database 
connection referenced in the context.jsp below:

            <Context path="/petstore"
                     docBase="/petstore"
                     debug="4"
                     reloadable="true"
                     crossContext="true">

               <Logger className="org.apache.catalina.logger.FileLogger"
                       prefix="petstore_localhost_examples_log." 
suffix=".txt"
                       timestamp="true"/>
               <Resource name="jdbc/EstoreDB"
                         auth="SERVLET"
                         type="javax.sql.DataSource"/>
               <ResourceParams name="java:comp/env/jdbc/EstoreDB">
                  <parameter>
                     <name>user</name>
                     <value>none</value>
                  </parameter>
                  <parameter>
                     <name>password</name>
                     <value>none</value>
                  </parameter>
                  <parameter>
                     <name>driverClassName</name>
                     <value>COM.cloudscape.core.JDBCDriver</value>
                  </parameter>
                  <parameter>
                     <name>driverName</name>
                     <value>jdbc:cloudscape:petStore</value>
                  </parameter>
               </ResourceParams>
            </Context>  

I modified the catalina.bat file to include the weblogic.jar file in the 
classpath. I then created a simple .jsp file:

<%@ page import="javax.naming.*" %>

<html>
<body>

<%
    out.println("<h2>System java.naming.factory.initial = " + 
System.getProperty("java.naming.factory.initial") + "</h2>");
    out.println("<h2>System java.naming.provider.url = " + 
System.getProperty("java.naming.provider.url") + "</h2>");
    out.println("<h2>System java.naming.security.principal = " + 
System.getProperty("java.naming.security.principal") + "</h2>");
    out.println("<h2>System java.naming.security.credentials = " + 
System.getProperty("java.naming.security.credentials") + "</h2>");
   
    out.println("<h2>Servlet Context java.naming.factory.initial = " + 
getServletContext().getInitParameter ("java.naming.factory.initial") + 
"</h2>");
    out.println("<h2>Servlet Context java.naming.provider.url = " + 
getServletContext().getInitParameter ("java.naming.provider.url") + 
"</h2>");
    out.println("<h2>Servlet Context java.naming.security.principal = " 
+ getServletContext().getInitParameter 
("java.naming.security.principal") + "</h2>");
    out.println("<h2>Servlet Context java.naming.security.credentials = 
" + getServletContext().getInitParameter 
("java.naming.security.credentials") + "</h2>");
   
    Context ctx = new InitialContext();

    Object obj = ctx.lookup("java:comp/env/jdbc/EstoreDB");

    out.println("<h2>Blah = " + obj.getClass().getName() + "</h2>");

   
%>

</body>
</html>

that I try to run first before executing the petstore app itself, and it 
gave me a host of servlet processing errors.


Any input would be most welcome!

Tad


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to