Skip to main content



      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] Thu, 05 January 2023 22:36 Go to next message
Eclipse UserFriend
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 75 times)

[Updated on: Thu, 05 January 2023 22:46] by Moderator

Re: Context cxt = new InitialContext() failed [message #1856873 is a reply to message #1856865] Fri, 06 January 2023 07:50 Go to previous messageGo to next message
Eclipse UserFriend
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 12:24] by Moderator

Re: Context cxt = new InitialContext() failed [message #1856909 is a reply to message #1856873] Mon, 09 January 2023 01:01 Go to previous message
Eclipse UserFriend
solved by changing app to fwk.

[Updated on: Mon, 09 January 2023 01:04] by Moderator

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


Current Time: Fri Apr 25 06:13:08 EDT 2025

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

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

Back to the top