Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Context cxt = new InitialContext() failed(javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.naming.java.javaURLContextFactory)
Context cxt = new InitialContext() failed [message #1856865] Fri, 06 January 2023 03:36 Go to next message
David Lee is currently offline David LeeFriend
Messages: 80
Registered: May 2013
Member
Hi,

We get DataSource from Tomcat for RAP applications use in either Activator.java or Application.java.
Context cxt = new InitialContext()
has no problem under environment below,
RAP 3.5
JDK 8u77
Tomcat 9.0.69

We tried to migrate to the followings but faild
RAP 3.17
openjdk-11.0.2 / jdk-11.0.16.1
Tomcat 9.0.69

According to the message box, problems occured on 'Context cxt = new InitialContext()'.
And we are sure the JNDI is OK due to 'Context cxt = new InitialContext()' in our another web service API works well without this problem.

the error message:
---
HTTP Status 500 Internal Server Error
Type Exception Report

Message Exception while executing application myRAPApp.Application

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

java.lang.RuntimeException: Exception while executing application myRAPApp.Application
org.eclipse.rap.ui.internal.application.EntryPointApplicationWrapper.createUI(EntryPointApplicationWrapper.java:44)
org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:290)
java.base/java.lang.Thread.run(Thread.java:834)
org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:107)
Root Cause

javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.naming.java.javaURLContextFactory [Root exception is java.lang.ClassNotFoundException: org.apache.naming.java.javaURLContextFactory]
java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:719)
java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
java.naming/javax.naming.InitialContext.<init>(InitialContext.java:184)
myRAPApp.Application.start(Application.java:139)
org.eclipse.rap.ui.internal.application.EntryPointApplicationWrapper.createUI(EntryPointApplicationWrapper.java:38)
org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:290)
java.base/java.lang.Thread.run(Thread.java:834)
org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:107)
...
---
myRAPApp.Application.start(Application.java:139) points to
Context cxt = new InitialContext();


We tried over and over agian, still can not figure out and find the solution.
Please help!
Thank you!

Best Regards,
David



  • Attachment: err1.jpg
    (Size: 15.35KB, Downloaded 36 times)

[Updated on: Fri, 06 January 2023 03:46]

Report message to a moderator

Re: Context cxt = new InitialContext() failed [message #1856873 is a reply to message #1856865] Fri, 06 January 2023 12:50 Go to previous messageGo to next message
David Lee is currently offline David LeeFriend
Messages: 80
Registered: May 2013
Member
In addition, the WEB-INF/launch.ini is
---
osgi.*=@null
org.osgi.*=@null
eclipse.*=@null
org.eclipse.*=@null

osgi.parentClassloader=app
osgi.contextClassLoaderParent=ccl
---

[Updated on: Fri, 06 January 2023 17:24]

Report message to a moderator

Re: Context cxt = new InitialContext() failed [message #1856909 is a reply to message #1856873] Mon, 09 January 2023 06:01 Go to previous message
David Lee is currently offline David LeeFriend
Messages: 80
Registered: May 2013
Member
solved by changing app to fwk.

[Updated on: Mon, 09 January 2023 06:04]

Report message to a moderator

Previous Topic:[ANN] RAP 3.23 Released!
Next Topic:How to work with RAP in 2023 ?
Goto Forum:
  


Current Time: Thu Jun 13 23:46:04 GMT 2024

Powered by FUDForum. Page generated in 0.03353 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top