Simon Kelly

Greenhorn
+ Follow
since Oct 02, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Simon Kelly

What java code do I need to write to find files for my application dynamically as resources i.e. under the WEB-INF/classes directory of my web app installation (war file)?
The issue of virtual paths within the archive files used to package J2EE applications has thrown my application off kilter. Previously the application was deployed as an exploded directory under Apache Tomcat. As I move to deploy it on WebLogic 7.0 it falls over because it uses "getServletContext().getRealPath("/")" to construct the searchpath for the files which are located below the web application root. As this call fails to return anything the
If anyone has an answer to the specific question above or any alternative useful suggestions as to how to approach solving this problem I would be very grateful!
Thanks in advance....
My servlet, which runs fine under ApacheTomCat 404 and WebLogic is not holding on to sessions when deployed under OAS 9iAS(9.0.3). It gives back a User Defined NotLoggedInException where it shouldn't because the session is null when in fact it should have been retrieved successfully from the HttpRequest with a call to "request.getSession(false)" upon entering "doPost".
Here is some tracing from my servlet, taken from the server logs for OAS and Tomcat respectively which might help :
Oracle 9iAS(9.0.3) :
MyServlet.printRequestInfo: just entered - session is null
MyServlet.printRequestInfo: isRequestedSessionIdFromCookie = true
MyServlet.printRequestInfo: isRequestedSessionIdFromURL = false
MyServlet.printRequestInfo: headerName = ACCEPT, headerValue = text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
MyServlet.printRequestInfo: headerName = CONNECTION, headerValue = keep-alive
MyServlet.printRequestInfo: headerName = CONTENT-LENGTH, headerValue = 564
MyServlet.printRequestInfo: headerName = CONTENT-TYPE, headerValue = java-internal/mypackage.MyClass
MyServlet.printRequestInfo: headerName = COOKIE, headerValue = JSESSIONID=821c13afbd3749e3ad7ba3832798ec3f.oQ9vokqUaN0KahD3lN4TawSLbxuIawSLbMSRckmTn3uInx8Knx0Pc6aRn2SHc30Ka2bJqA4Tok5N-AHwmkzB-AbDq6vzqBbJnBfDpAaImQXH8NqOc3aO8OjSq79zqRaxflvKqAjNqMbynknvrkLOlQzNp65In0__
MyServlet.printRequestInfo: headerName = HOST, headerValue = defMach:7777
MyServlet.printRequestInfo: headerName = USER-AGENT, headerValue = Java1.3.0
ApacheTomCat 404 :
MyServlet.printRequestInfo: just entered - session id is
= 5BF72D3108C7CA865C88B79EE5313F34
MyServlet.printRequestInfo: session is
= org.apache.catalina.session.StandardSessionFacade@5a18ac
MyServlet.printRequestInfo: isRequestedSessionIdFromCookie = true
MyServlet.printRequestInfo: isRequestedSessionIdFromURL = false
MyServlet.printRequestInfo: headerName = content-type, headerValue = java-internal/mypackage.MyClass MyServlet.printRequestInfo: headerName = cookie, headerValue = JSESSIONID=5BF72D3108C7CA865C88B79EE5313F34
MyServlet.printRequestInfo: headerName = user-agent, headerValue = Java1.3.0
MyServlet.printRequestInfo: headerName = host, headerValue = localhost:8001
MyServlet.printRequestInfo: headerName = accept, headerValue = text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
MyServlet.printRequestInfo: headerName = connection, headerValue = keep-alive
MyServlet.printRequestInfo: headerName = content-length, headerValue = 429
The cookie contains a session id in the request. The servlet container doesn't seem to have retained that session id though. I am thinking this problem arises from a peculiarity of the OAS servlet engine. Can anyone help on this issue.
Thanks in advance...
17 years ago
I am getting the following error upon server startup:
<Dec 12, 2002 7:54:15 PM MST> <Error> <JDBC> <001060> <Cannot startup connection pool "MyConnectionPool" java.sql.SQLException: No suitable driver>
My classpath contains Oracle's "classes12.jar". This is verified on the server console at startup.
The following are the relevant portions of my config.xml file in the domain root.
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
MaxCapacity="5" Name="MyConnectionPool"
Password="{3DES}OD0cIz1ljJk=" Properties="user=det"
Targets="MyServer" TestTableName="dual" URL="jdbc racle:thin@csdev1:1521 ev1"/>
<JDBCDataSource JNDIName="jdbc/MyDataSource"
Name="MyDataSource" PoolName="MyConnectionPool"/>
<JTA Name="MyDomain"/>
After setting my environment by navigating to the Domain root in a cmd box and running setEnv.cmd ...
CONTENTS OF setEnv.cmd
set CLASSPATH=C:\bea\weblogic700\server\lib\classes12.zip;%CLASSPATH%
set PATH=C:\bea\weblogic700\server\bin\oci817_8;%PATH%
call "C:\bea\weblogic700\server\bin\setWLSEnv.cmd"
...I ran the dbping utility and got the following error.
C:\bea\user_projects\ExodusDomain>java utils.dbping ORACLE user password dbname
Starting Loading jDriver/Oracle .....
Error encountered:
java.sql.SQLException: System.loadLibrary(weblogicoci38) threw java.lang.Unsatis
fiedLinkError: C:\bea\weblogic700\server\bin\oci817_8\weblogicoci38.dll: The spe
cified procedure could not be found
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:221)
at weblogic.jdbc.oci.Driver.connect(Driver.java:95)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:141)
at utils.dbping.main(dbping.java:157)
I did come across some mention of an oracle client installation requiring to be in my path.
Is anyone out there able to shine a light for me?
Update :
Still working on this one.
Would really appreciate some help.
I have now gotten the dbping utility to verify the connection and have set up the path and classpath identically for the server as for here and I am still getting 'Cannot startup connection pool - no suitable driver found' on startup!!
I really need help!!!

Thanks...
[ December 12, 2002: Message edited by: Simon Kelly ]
[ December 12, 2002: Message edited by: Simon Kelly ]
[ December 12, 2002: Message edited by: Simon Kelly ]
[ December 13, 2002: Message edited by: Simon Kelly ]
[ December 13, 2002: Message edited by: Simon Kelly ]
17 years ago
How do you bind the database connection to the JNDI Lookup. What xml dd files are you required to edit and what entries do you make? Is there any documentation provided by WL for these questions - apart from instructions on how to use their Management Console?
Thanks in advance...
17 years ago
I am actually having difficulty with this feature of J2EE 1.3 in WLS 7.0. I am trying to load supporting libraries with my ejb application. I have placed a jar file containing straight java classes, common.jar, in the "DOMAIN\applications" directory where my ejb jar is. The Manifest inside the ejb jar is generated by an ant task so should be syntactically ok. It is as follows:
Manifest-Version: 1.0
Created-By: Apache Ant 1.5
Class-Path: common.jar
If any one has any tips or pointers I would be very grateful. This is a real show stopper for me.
Regards,
Simon Kelly.
17 years ago
Thanks, that seems to have solved it!

Originally posted by Eric Ma:
When you created the domain using the domain wizard, it asked you to specify a server listen address. Did you leave it blank? If yes, you can use t3://localhost:7001; otherwise you have to use the exact name of the address you typed in.

Same machine thanks Tim!

Originally posted by Tim Holloway:
Got any firewalls between client and server?

Thanks for the response Dave. Unfortunately I still can't figure out the problem. Everything you mentioned checks out ok! The only thing I can think of is a jar from the weblogic library might be missing from the classpath. I have only so far included weblogic.jar. Do you know of any others that might be required.
Regards,
Simon Kelly.

Originally posted by Dave Landers:
What port is your server running on? Should say in the logs when the server starts. Like this:

<Oct 3, 2002 1:31:12 PM MDT> <Notice> <WebLogicServer> <000354> <Thread "ListenThread.Default" listening on port 7001>
Make sure it is 7001 or you change the port number in the InitialContext properties.
I assume the server is running on the same machine where your client is running, otherwise you'd need to replace "localhost" with the hostname or IP address of the server.
Try 127.0.0.1 rather than localhost? Nah.
Make sure the server is up. Logs should have something like:
<Oct 3, 2002 1:31:12 PM MDT> <Notice> <WebLogicServer> <000365> <Server state changed to RUNNING>
<Oct 3, 2002 1:31:12 PM MDT> <Notice> <WebLogicServer> <000360> <Server started in RUNNING mode>
Until you see that, it's not listening for connections.

I am having problems acquiring an InitialContext from Weblogic 7.0 Server from a simple java client. The following is the stack trace of the error followed by the InitialContext code. I have set the JAVA_HOME to use the jdk provided with WebLogic and WebLogic.jar is in the classpath. Can anyone help me with this? I would be very grateful.
TRACE:
C:\beanloader\package1<java package1.TestBeanLoader
<Oct 3, 2002 11:24:16 AM MDT< <Warning< <net< <000900< <Could not open connectio
n
java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
at java.net.Socket.<init<(Socket.java:290)
at java.net.Socket.<init<(Socket.java:146)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:214)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:276)
at weblogic.net.http.HttpClient.<init<(HttpClient.java:127)
at weblogic.net.http.HttpClient.New(HttpClient.java:169)
at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:11
1)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.
java:281)
at weblogic.rjvm.http.HTTPClientJVMConnection.connect(HTTPClientJVMConne
ction.java:218)
at weblogic.rjvm.http.HTTPClientJVMConnection.createConnection(HTTPClien
tJVMConnection.java:114)
at weblogic.rjvm.Protocol.createConnection(Protocol.java:234)
at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionMana
ger.java:1269)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:418)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:300)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java
:233)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:190)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:196
)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:162)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:262)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:323)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:221)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init<(InitialContext.java:195)
at package1.TestBeanLoader.init(TestBeanLoader.java:113)
at package1.TestBeanLoader.runTest(TestBeanLoader.java:42)
at package1.TestBeanLoader.main(TestBeanLoader.java:136)
<
NamingException caught : null
javax.naming.CommunicationException. Root exception is java.net.ConnectExceptio
n: http://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Tried all: '1' addresses, but could not conne
ct over HTTP to server: 'localhost', port: '7001'; No available router to destin
ation
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:173)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:262)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:323)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:221)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init<(InitialContext.java:195)
at package1.TestBeanLoader.init(TestBeanLoader.java:113)
at package1.TestBeanLoader.runTest(TestBeanLoader.java:42)
at package1.TestBeanLoader.main(TestBeanLoader.java:136)
Failed on InitialContext
Exception during execution
java.lang.NullPointerException
at package1.TestBeanLoader.runTest(TestBeanLoader.java:56)
at package1.TestBeanLoader.main(TestBeanLoader.java:136)
CODE:
Hashtable env = new Hashtable(5);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");

env.put(Context.PROVIDER_URL,
//"t3://localhost:7001";); -- same error
"http://localhost:7001";);
env.put(Context.SECURITY_PRINCIPAL,"xyz");
env.put(Context.SECURITY_CREDENTIALS,"xyz");
ctx = new InitialContext(env);
17 years ago
I am having problems acquiring an InitialContext from Weblogic 7.0 Server from a simple java client. The following is the stack trace of the error followed by the InitialContext code. I have set the JAVA_HOME to use the jdk provided with WebLogic and WebLogic.jar is in the classpath. Can anyone help me with this? I would be very grateful.
TRACE:
C:\beanloader\package1<java package1.TestBeanLoader
<Oct 3, 2002 11:24:16 AM MDT< <Warning< <net< <000900< <Could not open connectio
n
java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
at java.net.Socket.<init<(Socket.java:290)
at java.net.Socket.<init<(Socket.java:146)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:214)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:276)
at weblogic.net.http.HttpClient.<init<(HttpClient.java:127)
at weblogic.net.http.HttpClient.New(HttpClient.java:169)
at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:11
1)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.
java:281)
at weblogic.rjvm.http.HTTPClientJVMConnection.connect(HTTPClientJVMConne
ction.java:218)
at weblogic.rjvm.http.HTTPClientJVMConnection.createConnection(HTTPClien
tJVMConnection.java:114)
at weblogic.rjvm.Protocol.createConnection(Protocol.java:234)
at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionMana
ger.java:1269)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:418)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:300)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java
:233)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:190)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:196
)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:162)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:262)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:323)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:221)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init<(InitialContext.java:195)
at package1.TestBeanLoader.init(TestBeanLoader.java:113)
at package1.TestBeanLoader.runTest(TestBeanLoader.java:42)
at package1.TestBeanLoader.main(TestBeanLoader.java:136)
<
NamingException caught : null
javax.naming.CommunicationException. Root exception is java.net.ConnectExceptio
n: http://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Tried all: '1' addresses, but could not conne
ct over HTTP to server: 'localhost', port: '7001'; No available router to destin
ation
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:173)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:262)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:323)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:221)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init<(InitialContext.java:195)
at package1.TestBeanLoader.init(TestBeanLoader.java:113)
at package1.TestBeanLoader.runTest(TestBeanLoader.java:42)
at package1.TestBeanLoader.main(TestBeanLoader.java:136)
Failed on InitialContext
Exception during execution
java.lang.NullPointerException
at package1.TestBeanLoader.runTest(TestBeanLoader.java:56)
at package1.TestBeanLoader.main(TestBeanLoader.java:136)
CODE:
Hashtable env = new Hashtable(5);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");

env.put(Context.PROVIDER_URL,
//"t3://localhost:7001";); -- same error
"http://localhost:7001";);
env.put(Context.SECURITY_PRINCIPAL,"xyz");
env.put(Context.SECURITY_CREDENTIALS,"xyz");
ctx = new InitialContext(env);
I am having problems acquiring an InitialContext from Weblogic 7.0 Server from a simple java client. The following is the stack trace of the error followed by the InitialContext code. I have set the JAVA_HOME to use the jdk provided with WebLogic and WebLogic.jar is in the classpath. Can anyone help me with this? I would be very grateful.
TRACE:
C:\beanloader\package1<java package1.TestBeanLoader
<Oct 3, 2002 11:24:16 AM MDT< <Warning< <net< <000900< <Could not open connectio
n
java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
at java.net.Socket.<init<(Socket.java:290)
at java.net.Socket.<init<(Socket.java:146)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:214)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:276)
at weblogic.net.http.HttpClient.<init<(HttpClient.java:127)
at weblogic.net.http.HttpClient.New(HttpClient.java:169)
at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:11
1)
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.
java:281)
at weblogic.rjvm.http.HTTPClientJVMConnection.connect(HTTPClientJVMConne
ction.java:218)
at weblogic.rjvm.http.HTTPClientJVMConnection.createConnection(HTTPClien
tJVMConnection.java:114)
at weblogic.rjvm.Protocol.createConnection(Protocol.java:234)
at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionMana
ger.java:1269)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:418)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:300)
at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java
:233)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:190)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:196
)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:162)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:262)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:323)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:221)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init<(InitialContext.java:195)
at package1.TestBeanLoader.init(TestBeanLoader.java:113)
at package1.TestBeanLoader.runTest(TestBeanLoader.java:42)
at package1.TestBeanLoader.main(TestBeanLoader.java:136)
<
NamingException caught : null
javax.naming.CommunicationException. Root exception is java.net.ConnectExceptio
n: http://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Tried all: '1' addresses, but could not conne
ct over HTTP to server: 'localhost', port: '7001'; No available router to destin
ation
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:173)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:262)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:323)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:221)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init<(InitialContext.java:195)
at package1.TestBeanLoader.init(TestBeanLoader.java:113)
at package1.TestBeanLoader.runTest(TestBeanLoader.java:42)
at package1.TestBeanLoader.main(TestBeanLoader.java:136)
Failed on InitialContext
Exception during execution
java.lang.NullPointerException
at package1.TestBeanLoader.runTest(TestBeanLoader.java:56)
at package1.TestBeanLoader.main(TestBeanLoader.java:136)
CODE:
Hashtable env = new Hashtable(5);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");

env.put(Context.PROVIDER_URL,
//"t3://localhost:7001";); -- same error
"http://localhost:7001";);
env.put(Context.SECURITY_PRINCIPAL,"xyz");
env.put(Context.SECURITY_CREDENTIALS,"xyz");
ctx = new InitialContext(env);
17 years ago