Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » ClassNotFoundException: org.eclipse.jetty.jndi.InitialContextFactory in report preview
ClassNotFoundException: org.eclipse.jetty.jndi.InitialContextFactory in report preview [message #1772918] Mon, 18 September 2017 17:12 Go to next message
David Brock is currently offline David BrockFriend
Messages: 6
Registered: February 2014
Junior Member
I am using a custom ODA data source which uses an application Java API to connect to an application server running in JBoss. Connection to the application server works fine from the DataSource/DataSet UI's in Eclipse BIRT report designer. However when I preview a report I get the following error returned from the application API:

Reason - javax.naming.NoInitialContextException: Cannot instantiate class: org.eclipse.jetty.jndi.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.eclipse.jetty.jndi.InitialContextFactory]

What is the reason that this fails when running in the embedded Jetty env for the report preview, and is there a workaround that I can employ in the custom ODA, and/or in the Eclipse BIRT deployment?

Thanks!
David
Re: ClassNotFoundException: org.eclipse.jetty.jndi.InitialContextFactory in report preview [message #1772924 is a reply to message #1772918] Mon, 18 September 2017 18:41 Go to previous messageGo to next message
David Brock is currently offline David BrockFriend
Messages: 6
Registered: February 2014
Junior Member
I found a file called jetty.xml in the <eclipse>\plugins\org.eclipse.birt.report.viewer_4.6.0.v201606072122\jettyhome\etc directory.

I commented out the following lines, and seems to have solved the issue.

<!--
<Call class="java.lang.System" name="setProperty">
<Arg>java.naming.factory.initial</Arg>
<Arg><Property name="java.naming.factory.initial" default="org.eclipse.jetty.jndi.InitialContextFactory"/></Arg>
</Call>
<Call class="java.lang.System" name="setProperty">
<Arg>java.naming.factory.url.pkgs</Arg>
<Arg><Property name="java.naming.factory.url.pkgs" default="org.eclipse.jetty.jndi"/></Arg>
</Call>
-->

Is this an OK workaround? Will this affect anything else in the Report Designer?

Thanks,
David
Re: ClassNotFoundException: org.eclipse.jetty.jndi.InitialContextFactory in report preview [message #1794160 is a reply to message #1772924] Fri, 24 August 2018 16:25 Go to previous message
David Brock is currently offline David BrockFriend
Messages: 6
Registered: February 2014
Junior Member
Update: This workaround no longer works in 4.8. I get an error that java.naming.factory.initial must be set. So I left this section uncommented, and in instead in my ODA code, right before I attempt to connect to my data source, I placed the following:

System.clearProperty("java.naming.factory.initial");

The jetty server starts before the ODA "open" method is called, so seems to be OK. Has worked fine so far in my testing.

Thanks,
David
Previous Topic:Need to remove dependency on WSDL4J 1.5.1 plugin
Next Topic:X Axis label
Goto Forum:
  


Current Time: Thu Apr 25 13:12:21 GMT 2024

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

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

Back to the top