NoInitialContextException [message #1866525] |
Fri, 31 May 2024 11:17  |
Kalai S 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 47 times)
Attachment: Error1.png
(Size: 190.22KB, Downloaded 44 times)
Attachment: urlError.png
(Size: 80.48KB, Downloaded 39 times)
Attachment: persistence_xml.txt
(Size: 7.64KB, Downloaded 34 times)
Attachment: Logs.txt
(Size: 32.26KB, Downloaded 48 times)
|
|
|
Re: NoInitialContextException [message #1874443 is a reply to message #1866525] |
Tue, 07 January 2025 17:53  |
Eclipse User |
|
|
|
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?
|
|
|
Powered by
FUDForum. Page generated in 0.03651 seconds