>Number:         5026
>Category:       mod_jserv
>Synopsis:       Using InitalContext(Properties p) on weblogic 4.03 produces 
>EMERGENCY in log file
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Sep 17 02:40:00 PDT 1999
>Last-Modified:
>Originator:     [EMAIL PROTECTED]
>Organization:
apache
>Release:        Apache 1.3.9 / JServ 1.0
>Environment:
Solaris 2.7 / jdk 1.1.7-8
>Description:
Hi, the following snippet of code works fine standalone, but crashes
JServ when used in JSPīs or in Servlets. Iīve verified the error using
GSP, GNU jsp (both 1.0cvs and 0.9.10) and a servlet. 

The snippet of code works fine with sunīs reference implementation
jwsdk, and when running it standalone, so itīs probably not a problem
with Weblogicīs application server. 


>How-To-Repeat:
this is the standalone program that works: 

import javax.naming.*;
import javax.ejb.*;
import javax.jts.*;
import java.rmi.RemoteException;
import java.util.*;
import java.sql.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class JServBug {

    static String lacName = "reinhard";
    static String lacPassword   = "";
    static String busId = "052";
    static String weblogicUrl = "t3s://history.andsold.de:7004";


    public static void main (String args[]) {
        System.out.println("Hello world");

        try {
            Properties p = new Properties();
            p.put(Context.INITIAL_CONTEXT_FACTORY,
                  "weblogic.jndi.TengahInitialContextFactory");
            p.put(Context.PROVIDER_URL, weblogicUrl);
            InitialContext ctx  = new InitialContext(p);
        } catch (Exception e) {
            System.out.println (e.getMessage()); 
        }
    }
}

Hereīs the GSP page that crashes JServ 1.0: 

<html>
<head>
<title>Mein ANDSOLD (Historie)</title>

</head>
<body>

<java type="import">java.util.Date</java>
<java type="import">javax.naming.*</java>
<java type="import">javax.ejb.*</java>
<java type="import">javax.jts.*</java>
<java type="import">java.rmi.RemoteException</java>
<java type="import">java.util.*</java>
<java type="import">java.sql.*</java>
<java type="import">java.math.*</java>
<java type="import">java.text.*</java>
<java type="import">java.util.*</java>

<h3> hello world </h3>

<java type="class">
public Context getInitialContext(String url) throws Exception
{
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
      "weblogic.jndi.TengahInitialContextFactory");
p.put(Context.PROVIDER_URL, url);
return new InitialContext(p);
}
</java>

<java>
String lacName = "foobar";
String  lacPassword   = "ugu";
String  busId   = "666";
String weblogicUrl = "t3s://history.andsold.de:7004";
out.print("Hello world");

try {
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY,
          "weblogic.jndi.TengahInitialContextFactory");
    p.put(Context.PROVIDER_URL, weblogicUrl);
    InitialContext ic = new InitialContext(p);

} catch(Exception ex1) {
    out.print(ex1);
}
</java>

</body>
</html>

Running that page results in the following messages being written to 
the jserv log file: 

[17/09/1999 12:57:25 GMT+03:30]  GspServlet: warning - upload.dir not set.  
Using /tmp by default
[17/09/1999 12:57:25 GMT+03:30]  GspServlet: warning - upload.maxfilesize not 
set.  Using 1000000 bytes by default
[17/09/1999 12:57:25 GMT+03:30]  GspServlet started successfully at: Fri Sep 17 
12:57:25 GMT+03:30 1999
[17/09/1999 11:28:04:116] (EMERGENCY) ajp11: cannot scan servlet headers
[17/09/1999 11:28:04:116] (ERROR) an error returned handling request via 
protocol "ajpv11"
[17/09/1999 12:58:06 GMT+03:30]  ApacheJServ/1.0 is starting...
[17/09/1999 12:58:06 GMT+03:30]  WARNING: connection authentication is disabled
[17/09/1999 12:58:06 GMT+03:30]  Connection allowed from localhost/127.0.0.1
[17/09/1999 12:58:06 GMT+03:30]  Listening on port 8007 accepting 50 maximum 
connections

If you need more information Iīd be happy to provide it. 
>Fix:
No, not at the moment. As we need to use SSL we cannot use Sunīs 
implemenatation, but it wonīt work with Apache/JServ... looks like
a catch-22. 

Keep up the good work, and again, if I can be of any help, Iīll try
my very best. 


Uwe
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <[EMAIL PROTECTED]> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]



Reply via email to