Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NoInitialContextException(javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or in an application resource file: java.naming.factory.initial)
NoInitialContextException [message #1866525] Fri, 31 May 2024 11:17 Go to next message
Kalai S is currently offline Kalai SFriend
Messages: 3
Registered: April 2024
Junior Member
I am getting the following error while trying to run a standalone JPATest.java file.
Here, I am trying to establish the jdbc connection which I am failed to do so because of the following errors.
The initial error said there's no InitialContextFactory [ss: Error1]. Hence, I set it up manually like in the attached ss [ss: JPATest].
But when I set the context factory, I also was supposed to give the provider_url which is not being taken by the context factory I set. It is showing the following error in this place.
Error: javax.naming.InvalidNameException: jdbc:db2://fcb45d24-a890-421f-a658-96d02aada705.c1ogj3sd0tgtu0lqde00.databases.appdomain.cloud:31938/bludb;sslConnection=true; [Root exception is java.net.MalformedURLException: unknown protocol: jdbc]
Please refer to ss: urlError for the full error message.

Also, please find attached my peristence.xml file[ss: persistence_xml].
I have attached the entire logs as well [ss: Logs].

Note: This error is now happening in both java8[in prod right now] and in java17, which we conclude this is because of some configuration issue but not any jar incompatibility issues.

Please help since this is a sev1 issue.
  • Attachment: JPATest.png
    (Size: 135.29KB, Downloaded 45 times)
  • Attachment: Error1.png
    (Size: 190.22KB, Downloaded 41 times)
  • Attachment: urlError.png
    (Size: 80.48KB, Downloaded 36 times)
  • Attachment: persistence_xml.txt
    (Size: 7.64KB, Downloaded 32 times)
  • Attachment: Logs.txt
    (Size: 32.26KB, Downloaded 46 times)
Re: NoInitialContextException [message #1874443 is a reply to message #1866525] Tue, 07 January 2025 17:53 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 60
Registered: December 2021
Member
This issue doesn't have to do with EclipseLink/JPA but with your context configuration, which doesn't seem to be needed - you aren't even showing where you initialize the context with these properties (line 500 in your code) or why you need to do so. As for the config itself: why are you passing in what appears to be a Database URL as a context provider to the RefFSContextFactory class?
Previous Topic:java.sql.SQLIntegrityConstraintViolationException: Duplicate entry when persisting an entity
Goto Forum:
  


Current Time: Thu Jan 23 08:24:19 GMT 2025

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

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

Back to the top