Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » JDBC Driver classpath in BIRT RCP Designer Problem
JDBC Driver classpath in BIRT RCP Designer Problem [message #368440] Fri, 29 May 2009 14:52 Go to next message
David Johns is currently offline David JohnsFriend
Messages: 15
Registered: July 2009
Junior Member
I have a custom JDBC driver that I need to use while creating reports in
the BIRT RCP Designer. I have run into two problems depending on the
version of BIRT that I am running and I don¡Št know how to resolve them.
I would like to determine a way that would work for both Birt2.2.2 and
Birt2.3.2 versions if possible.

I am not having a problem when I go to run the reports in my application,
as they are embedded in my application and it replaces the data source
using a JNDI lookup, so my problem is only when previewing and viewing
reports from the BIRT RCP Designer.

JDBC Driver Requirements:
Main jar: AjJDBC.jar
Supporting jars: AjConnectors.jar, wlfullclient.jar, sqljdbc.jar

All of these files need to be in the classpath when connecting and
querying the data. The driver wraps the normal sql server jdbc driver and
makes JEE calls to Weblogic when it intercepts certain data fields being
returned in the result set. Also, part of this is using the Java Security
Framework (JAAS) to log in to Weblogic.

This works fine outside of BIRT when it has everything in it¡Šs class
path. However, I am getting class not found errors in BIRT during
different circumstances when previewing a report.

Problem Summaries:
Problem 1: Cannot put all .jar files in ¡K/drivers directory because it
causes BIRT to hang when viewing the DataSource because of .jar size
(wlfullclient.jar is 56MB).

Problem 2: Even if all .jar files are in the ../drivers directory, in
Birt 2.2.2 when previewing a report, the ContextClassLoader is a WebApp
classloader and the login security has the wrong classloader, so it cannot
find and load subject during the login.

I can provide a lot more details of what I have tried if you are
interested ƒŒ

Requested solution:
I am looking for a solution that would let me configure BIRT so that I
would not have to modify my jdbc driver, but when Birt was accessing the
ODA JDBC data source using my JDBC driver it will have the correct .jar
files available to the correct class loader.

If that is not possible, then I need to know what the appropriate changes
would be to correctly let clients use the BIRT RCP Designer with our JDBC
driver.

Any help in this would be greatly appreciated.
Re: JDBC Driver classpath in BIRT RCP Designer Problem [message #368465 is a reply to message #368440] Mon, 01 June 2009 16:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

David,

In 2.3.2 you can set the location of the drivers in the app context, but
I am not certain this will fix your issue. It should be able to load up
all the jars in the drivers directory. Can you open a bug with the
stacktrace you get when trying this method?

Jason

David Johns wrote:
> I have a custom JDBC driver that I need to use while creating reports in
> the BIRT RCP Designer. I have run into two problems depending on the
> version of BIRT that I am running and I don¡Št know how to resolve
> them. I would like to determine a way that would work for both
> Birt2.2.2 and Birt2.3.2 versions if possible.
> I am not having a problem when I go to run the reports in my
> application, as they are embedded in my application and it replaces the
> data source using a JNDI lookup, so my problem is only when previewing
> and viewing reports from the BIRT RCP Designer.
>
> JDBC Driver Requirements:
> Main jar: AjJDBC.jar
> Supporting jars: AjConnectors.jar, wlfullclient.jar, sqljdbc.jar
>
> All of these files need to be in the classpath when connecting and
> querying the data. The driver wraps the normal sql server jdbc driver
> and makes JEE calls to Weblogic when it intercepts certain data fields
> being returned in the result set. Also, part of this is using the Java
> Security Framework (JAAS) to log in to Weblogic.
>
> This works fine outside of BIRT when it has everything in it¡Šs class
> path. However, I am getting class not found errors in BIRT during
> different circumstances when previewing a report.
>
> Problem Summaries:
> Problem 1: Cannot put all .jar files in ¡K/drivers directory because it
> causes BIRT to hang when viewing the DataSource because of .jar size
> (wlfullclient.jar is 56MB).
>
> Problem 2: Even if all .jar files are in the ../drivers directory, in
> Birt 2.2.2 when previewing a report, the ContextClassLoader is a WebApp
> classloader and the login security has the wrong classloader, so it
> cannot find and load subject during the login.
>
> I can provide a lot more details of what I have tried if you are
> interested �Œ
>
> Requested solution:
> I am looking for a solution that would let me configure BIRT so that I
> would not have to modify my jdbc driver, but when Birt was accessing the
> ODA JDBC data source using my JDBC driver it will have the correct .jar
> files available to the correct class loader.
> If that is not possible, then I need to know what the appropriate
> changes would be to correctly let clients use the BIRT RCP Designer with
> our JDBC driver.
>
> Any help in this would be greatly appreciated.
>
>
Re: JDBC Driver classpath in BIRT RCP Designer Problem [message #368515 is a reply to message #368465] Fri, 05 June 2009 22:22 Go to previous messageGo to next message
David Johns is currently offline David JohnsFriend
Messages: 15
Registered: July 2009
Junior Member
Jason,

You indicated that I can set the "app context", can you refer me to some
documentation on this. (Is there a configuration setting that I can make
when viewing reports inside Birt RCP?) I must just be looking in the wrong
spot.

Also, for 2.3.2 I assume the problem I am having when all of my JDBC
driver dependencies in the .../driver directory is because it is scanning
my wlfullclient.jar file to see if it is a JDBC driver (since it is in the
.../driver directory.) If there is a way to move it out of that directory
and still have it in the classpath (and specifically in the path for the
ContextClassloader) I assume that should solve the problem.

If I put all of the driver info in the
...report.data.oda.jdbc_versionInfo/driver, as long as I don't go into the
DataSource, it appears to work correctly. When I go into the datasource,
then I just get the hourglass for a very long time (I will let it continue
to run and see if I get a response, it has been running for over 30
minutes so far).

If I can get a stacktrace after it blows up, I will create open a bug.

Thanks for your help.

David

Jason Weathersby wrote:

> David,

> In 2.3.2 you can set the location of the drivers in the app context, but
> I am not certain this will fix your issue. It should be able to load up
> all the jars in the drivers directory. Can you open a bug with the
> stacktrace you get when trying this method?

> Jason

> David Johns wrote:
>> I have a custom JDBC driver that I need to use while creating reports in
>> the BIRT RCP Designer. I have run into two problems depending on the
>> version of BIRT that I am running and I don¡Št know how to resolve
>> them. I would like to determine a way that would work for both
>> Birt2.2.2 and Birt2.3.2 versions if possible.
>> I am not having a problem when I go to run the reports in my
>> application, as they are embedded in my application and it replaces the
>> data source using a JNDI lookup, so my problem is only when previewing
>> and viewing reports from the BIRT RCP Designer.
>>
>> JDBC Driver Requirements:
>> Main jar: AjJDBC.jar
>> Supporting jars: AjConnectors.jar, wlfullclient.jar, sqljdbc.jar
>>
>> All of these files need to be in the classpath when connecting and
>> querying the data. The driver wraps the normal sql server jdbc driver
>> and makes JEE calls to Weblogic when it intercepts certain data fields
>> being returned in the result set. Also, part of this is using the Java
>> Security Framework (JAAS) to log in to Weblogic.
>>
>> This works fine outside of BIRT when it has everything in it¡Šs class
>> path. However, I am getting class not found errors in BIRT during
>> different circumstances when previewing a report.
>>
>> Problem Summaries:
>> Problem 1: Cannot put all .jar files in ¡K/drivers directory because it
>> causes BIRT to hang when viewing the DataSource because of .jar size
>> (wlfullclient.jar is 56MB).
>>
>> Problem 2: Even if all .jar files are in the ../drivers directory, in
>> Birt 2.2.2 when previewing a report, the ContextClassLoader is a WebApp
>> classloader and the login security has the wrong classloader, so it
>> cannot find and load subject during the login.
>>
>> I can provide a lot more details of what I have tried if you are
>> interested ᅵŒ
>>
>> Requested solution:
>> I am looking for a solution that would let me configure BIRT so that I
>> would not have to modify my jdbc driver, but when Birt was accessing the
>> ODA JDBC data source using my JDBC driver it will have the correct .jar
>> files available to the correct class loader.
>> If that is not possible, then I need to know what the appropriate
>> changes would be to correctly let clients use the BIRT RCP Designer with
>> our JDBC driver.
>>
>> Any help in this would be greatly appreciated.
>>
>>
Re: JDBC Driver classpath in BIRT RCP Designer Problem [message #368528 is a reply to message #368515] Mon, 08 June 2009 14:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

David,

Before modifying the app context in your app code try adding the
following to the beforeFactory script of a test report:

reportContext.getAppContext().put("OdaJDBCDriverClassPath",
"C:/apps/apache-tomcat-5.5.20/webapps/2.3rc1/WEB-INF/lib");

Obviously change the path. If this works
Take a look at this blog:
http://birtworld.blogspot.com/2008/11/birt-connection-poolin g-continued-again.html

If you are using the Viewer and not the API you will can set up the app
context like the following:
1 - add this like before you launch the viewer in your RCP app

ViewerPlugin.getDefault( ).getPluginPreferences(
).setValue("APPCONTEXT_EXTENSION_KEY", "MyAppContext");


Implement MyAppContext like:


package org.eclipse.birt.examples.rcpviewer;

import java.util.Map;

import org.eclipse.birt.report.viewer.api.AppContextExtension;

public class MyAppContext extends AppContextExtension{

@Override
public Map getAppContext(Map appContext) {

Map hm = super.getAppContext(appContext);
hm.put("PARENT_CLASSLOADER", PreviewBirtAction.class.getClassLoader());
//hm.put("webapplication.projectclasspath", "c:/jars/mjo.jar");
//add the jdbc driver path variable mention above here
return hm;

}

@Override
public String getName() {
// TODO Auto-generated method stub
return "MyAppContext";
}

Jason


David Johns wrote:
> Jason,
>
> You indicated that I can set the "app context", can you refer me to some
> documentation on this. (Is there a configuration setting that I can make
> when viewing reports inside Birt RCP?) I must just be looking in the
> wrong spot.
> Also, for 2.3.2 I assume the problem I am having when all of my JDBC
> driver dependencies in the .../driver directory is because it is
> scanning my wlfullclient.jar file to see if it is a JDBC driver (since
> it is in the ../driver directory.) If there is a way to move it out of
> that directory and still have it in the classpath (and specifically in
> the path for the ContextClassloader) I assume that should solve the
> problem.
>
> If I put all of the driver info in the
> ..report.data.oda.jdbc_versionInfo/driver, as long as I don't go into
> the DataSource, it appears to work correctly. When I go into the
> datasource, then I just get the hourglass for a very long time (I will
> let it continue to run and see if I get a response, it has been running
> for over 30 minutes so far).
>
> If I can get a stacktrace after it blows up, I will create open a bug.
>
> Thanks for your help.
>
> David
>
> Jason Weathersby wrote:
>
>> David,
>
>> In 2.3.2 you can set the location of the drivers in the app context,
>> but I am not certain this will fix your issue. It should be able to
>> load up all the jars in the drivers directory. Can you open a bug
>> with the stacktrace you get when trying this method?
>
>> Jason
>
>> David Johns wrote:
>>> I have a custom JDBC driver that I need to use while creating reports
>>> in the BIRT RCP Designer. I have run into two problems depending on
>>> the version of BIRT that I am running and I don¡Št know how to
>>> resolve them. I would like to determine a way that would work for
>>> both Birt2.2.2 and Birt2.3.2 versions if possible. I am not having a
>>> problem when I go to run the reports in my application, as they are
>>> embedded in my application and it replaces the data source using a
>>> JNDI lookup, so my problem is only when previewing and viewing
>>> reports from the BIRT RCP Designer.
>>>
>>> JDBC Driver Requirements:
>>> Main jar: AjJDBC.jar
>>> Supporting jars: AjConnectors.jar, wlfullclient.jar, sqljdbc.jar
>>>
>>> All of these files need to be in the classpath when connecting and
>>> querying the data. The driver wraps the normal sql server jdbc
>>> driver and makes JEE calls to Weblogic when it intercepts certain
>>> data fields being returned in the result set. Also, part of this is
>>> using the Java Security Framework (JAAS) to log in to Weblogic.
>>>
>>> This works fine outside of BIRT when it has everything in it¡Šs
>>> class path. However, I am getting class not found errors in BIRT
>>> during different circumstances when previewing a report.
>>>
>>> Problem Summaries:
>>> Problem 1: Cannot put all .jar files in ¡K/drivers directory
>>> because it causes BIRT to hang when viewing the DataSource because of
>>> .jar size (wlfullclient.jar is 56MB).
>>>
>>> Problem 2: Even if all .jar files are in the ../drivers directory,
>>> in Birt 2.2.2 when previewing a report, the ContextClassLoader is a
>>> WebApp classloader and the login security has the wrong classloader,
>>> so it cannot find and load subject during the login.
>>>
>>> I can provide a lot more details of what I have tried if you are
>>> interested ᅵ�
>>>
>>> Requested solution:
>>> I am looking for a solution that would let me configure BIRT so that
>>> I would not have to modify my jdbc driver, but when Birt was
>>> accessing the ODA JDBC data source using my JDBC driver it will have
>>> the correct .jar files available to the correct class loader. If that
>>> is not possible, then I need to know what the appropriate changes
>>> would be to correctly let clients use the BIRT RCP Designer with our
>>> JDBC driver.
>>>
>>> Any help in this would be greatly appreciated.
>>>
>>>
>
>
Re: JDBC Driver classpath in BIRT RCP Designer Problem [message #368672 is a reply to message #368528] Thu, 18 June 2009 14:46 Go to previous messageGo to next message
David Johns is currently offline David JohnsFriend
Messages: 15
Registered: July 2009
Junior Member
Jason,

Sorry about the delays in responses we are just getting out our release,
so this was moved down in priority, then put back as my top priority again.

I think I might have introduced some confusion in what I am trying to do.
I would like to be able to create a set of instructions for report
designers that will be using our product on how to configure their BIRT
RCP Report Designer. After our clients have created a report, they can
then inport the report into our application, and everything is working
correctly as we override the DataSource that they configure in the report.


However, when designing the report, our JDBC driver needs to connect to
the Weblogic 10.3 appserver to resolve some of the data fields (derived
fields). Our driver has an option that can be specified to not attempt to
resolve these fields and they will return a null (which is what they are
doing now). However, our requirement has changed so that now I must
provide the values for the derived fields. This is where our driver is
having problems when it is attempting to connect to weblogic.

So I am trying to create step by step instructions for our clients of what
they need to do inside the BIRT RCP Designer to create a valid data source
to use while designing the reports. (We replace the datasource inside our
App, so it is only for the Report Designer tool that this matters).

That being said (sorry it is so verbose), I attempted adding the
beforeFactory script that you recommended, and it did not work. I got a
java.lang.NoClassDefFoundError when doing a connection test inside the
Edit Data Source window.

In Birt 2.2.2 I have been able to make some modifications to get items to
work, however, I have changed the ContextClassLoader when getting a
connection to the class loader of my driver class (and don't change it
back). I am not sure what the ramifications of that are so I am trying to
handle this properly.

Also, I realized if I can connect to the Weblogic DataSource, that should
also provide a solution for me. I am having problems doing that, however,
I will post that info on a different thread that seems to have a more
appropriate title.

Thank you for your help and comments.

David


Jason Weathersby wrote:

> David,

> Before modifying the app context in your app code try adding the
> following to the beforeFactory script of a test report:

> reportContext.getAppContext().put("OdaJDBCDriverClassPath",
> "C:/apps/apache-tomcat-5.5.20/webapps/2.3rc1/WEB-INF/lib");

> Obviously change the path. If this works
> Take a look at this blog:
>
http://birtworld.blogspot.com/2008/11/birt-connection-poolin g-continued-again.html

> If you are using the Viewer and not the API you will can set up the app
> context like the following:
> 1 - add this like before you launch the viewer in your RCP app

> ViewerPlugin.getDefault( ).getPluginPreferences(
> ).setValue("APPCONTEXT_EXTENSION_KEY", "MyAppContext");


> Implement MyAppContext like:


> package org.eclipse.birt.examples.rcpviewer;

> import java.util.Map;

> import org.eclipse.birt.report.viewer.api.AppContextExtension;

> public class MyAppContext extends AppContextExtension{

> @Override
> public Map getAppContext(Map appContext) {

> Map hm = super.getAppContext(appContext);
> hm.put("PARENT_CLASSLOADER", PreviewBirtAction.class.getClassLoader());
> //hm.put("webapplication.projectclasspath", "c:/jars/mjo.jar");
> //add the jdbc driver path variable mention above here
> return hm;

> }

> @Override
> public String getName() {
> // TODO Auto-generated method stub
> return "MyAppContext";
> }

> Jason


> David Johns wrote:
>> Jason,
>>
>> You indicated that I can set the "app context", can you refer me to some
>> documentation on this. (Is there a configuration setting that I can make
>> when viewing reports inside Birt RCP?) I must just be looking in the
>> wrong spot.
>> Also, for 2.3.2 I assume the problem I am having when all of my JDBC
>> driver dependencies in the .../driver directory is because it is
>> scanning my wlfullclient.jar file to see if it is a JDBC driver (since
>> it is in the ../driver directory.) If there is a way to move it out of
>> that directory and still have it in the classpath (and specifically in
>> the path for the ContextClassloader) I assume that should solve the
>> problem.
>>
>> If I put all of the driver info in the
>> ..report.data.oda.jdbc_versionInfo/driver, as long as I don't go into
>> the DataSource, it appears to work correctly. When I go into the
>> datasource, then I just get the hourglass for a very long time (I will
>> let it continue to run and see if I get a response, it has been running
>> for over 30 minutes so far).
>>
>> If I can get a stacktrace after it blows up, I will create open a bug.
>>
>> Thanks for your help.
>>
>> David
>>
>> Jason Weathersby wrote:
>>
>>> David,
>>
>>> In 2.3.2 you can set the location of the drivers in the app context,
>>> but I am not certain this will fix your issue. It should be able to
>>> load up all the jars in the drivers directory. Can you open a bug
>>> with the stacktrace you get when trying this method?
>>
>>> Jason
>>
>>> David Johns wrote:
>>>> I have a custom JDBC driver that I need to use while creating reports
>>>> in the BIRT RCP Designer. I have run into two problems depending on
>>>> the version of BIRT that I am running and I don¡Št know how to
>>>> resolve them. I would like to determine a way that would work for
>>>> both Birt2.2.2 and Birt2.3.2 versions if possible. I am not having a
>>>> problem when I go to run the reports in my application, as they are
>>>> embedded in my application and it replaces the data source using a
>>>> JNDI lookup, so my problem is only when previewing and viewing
>>>> reports from the BIRT RCP Designer.
>>>>
>>>> JDBC Driver Requirements:
>>>> Main jar: AjJDBC.jar
>>>> Supporting jars: AjConnectors.jar, wlfullclient.jar, sqljdbc.jar
>>>>
>>>> All of these files need to be in the classpath when connecting and
>>>> querying the data. The driver wraps the normal sql server jdbc
>>>> driver and makes JEE calls to Weblogic when it intercepts certain
>>>> data fields being returned in the result set. Also, part of this is
>>>> using the Java Security Framework (JAAS) to log in to Weblogic.
>>>>
>>>> This works fine outside of BIRT when it has everything in it¡Šs
>>>> class path. However, I am getting class not found errors in BIRT
>>>> during different circumstances when previewing a report.
>>>>
>>>> Problem Summaries:
>>>> Problem 1: Cannot put all .jar files in ¡K/drivers directory
>>>> because it causes BIRT to hang when viewing the DataSource because of
>>>> .jar size (wlfullclient.jar is 56MB).
>>>>
>>>> Problem 2: Even if all .jar files are in the ../drivers directory,
>>>> in Birt 2.2.2 when previewing a report, the ContextClassLoader is a
>>>> WebApp classloader and the login security has the wrong classloader,
>>>> so it cannot find and load subject during the login.
>>>>
>>>> I can provide a lot more details of what I have tried if you are
>>>> interested ï¿œÅᅵ
>>>>
>>>> Requested solution:
>>>> I am looking for a solution that would let me configure BIRT so that
>>>> I would not have to modify my jdbc driver, but when Birt was
>>>> accessing the ODA JDBC data source using my JDBC driver it will have
>>>> the correct .jar files available to the correct class loader. If that
>>>> is not possible, then I need to know what the appropriate changes
>>>> would be to correctly let clients use the BIRT RCP Designer with our
>>>> JDBC driver.
>>>>
>>>> Any help in this would be greatly appreciated.
>>>>
>>>>
>>
>>
Re: JDBC Driver classpath in BIRT RCP Designer Problem [message #368684 is a reply to message #368672] Thu, 18 June 2009 19:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

David,

Which ODA are you using to design the reports (Your own or JDBC)?

Jason

David Johns wrote:
> Jason,
>
> Sorry about the delays in responses we are just getting out our release,
> so this was moved down in priority, then put back as my top priority again.
>
> I think I might have introduced some confusion in what I am trying to
> do. I would like to be able to create a set of instructions for report
> designers that will be using our product on how to configure their BIRT
> RCP Report Designer. After our clients have created a report, they can
> then inport the report into our application, and everything is working
> correctly as we override the DataSource that they configure in the report.
>
> However, when designing the report, our JDBC driver needs to connect to
> the Weblogic 10.3 appserver to resolve some of the data fields (derived
> fields). Our driver has an option that can be specified to not attempt
> to resolve these fields and they will return a null (which is what they
> are doing now). However, our requirement has changed so that now I must
> provide the values for the derived fields. This is where our driver is
> having problems when it is attempting to connect to weblogic.
>
> So I am trying to create step by step instructions for our clients of
> what they need to do inside the BIRT RCP Designer to create a valid data
> source to use while designing the reports. (We replace the datasource
> inside our App, so it is only for the Report Designer tool that this
> matters).
>
> That being said (sorry it is so verbose), I attempted adding the
> beforeFactory script that you recommended, and it did not work. I got a
> java.lang.NoClassDefFoundError when doing a connection test inside the
> Edit Data Source window.
>
> In Birt 2.2.2 I have been able to make some modifications to get items
> to work, however, I have changed the ContextClassLoader when getting a
> connection to the class loader of my driver class (and don't change it
> back). I am not sure what the ramifications of that are so I am trying
> to handle this properly.
>
> Also, I realized if I can connect to the Weblogic DataSource, that
> should also provide a solution for me. I am having problems doing that,
> however, I will post that info on a different thread that seems to have
> a more appropriate title.
>
> Thank you for your help and comments.
>
> David
>
>
> Jason Weathersby wrote:
>
>> David,
>
>> Before modifying the app context in your app code try adding the
>> following to the beforeFactory script of a test report:
>
>> reportContext.getAppContext().put("OdaJDBCDriverClassPath",
>> "C:/apps/apache-tomcat-5.5.20/webapps/2.3rc1/WEB-INF/lib");
>
>> Obviously change the path. If this works
>> Take a look at this blog:
>>
> http://birtworld.blogspot.com/2008/11/birt-connection-poolin g-continued-again.html
>
>
>> If you are using the Viewer and not the API you will can set up the
>> app context like the following:
>> 1 - add this like before you launch the viewer in your RCP app
>
>> ViewerPlugin.getDefault( ).getPluginPreferences(
>> ).setValue("APPCONTEXT_EXTENSION_KEY", "MyAppContext");
>
>
>> Implement MyAppContext like:
>
>
>> package org.eclipse.birt.examples.rcpviewer;
>
>> import java.util.Map;
>
>> import org.eclipse.birt.report.viewer.api.AppContextExtension;
>
>> public class MyAppContext extends AppContextExtension{
>
>> @Override
>> public Map getAppContext(Map appContext) {
>
>> Map hm = super.getAppContext(appContext);
>> hm.put("PARENT_CLASSLOADER",
>> PreviewBirtAction.class.getClassLoader());
>> //hm.put("webapplication.projectclasspath", "c:/jars/mjo.jar");
>> //add the jdbc driver path variable mention above here
>> return hm;
>
>> }
>
>> @Override
>> public String getName() {
>> // TODO Auto-generated method stub
>> return "MyAppContext";
>> }
>
>> Jason
>
>
>> David Johns wrote:
>>> Jason,
>>>
>>> You indicated that I can set the "app context", can you refer me to
>>> some documentation on this. (Is there a configuration setting that I
>>> can make when viewing reports inside Birt RCP?) I must just be
>>> looking in the wrong spot.
>>> Also, for 2.3.2 I assume the problem I am having when all of my JDBC
>>> driver dependencies in the .../driver directory is because it is
>>> scanning my wlfullclient.jar file to see if it is a JDBC driver
>>> (since it is in the ../driver directory.) If there is a way to move
>>> it out of that directory and still have it in the classpath (and
>>> specifically in the path for the ContextClassloader) I assume that
>>> should solve the problem.
>>>
>>> If I put all of the driver info in the
>>> ..report.data.oda.jdbc_versionInfo/driver, as long as I don't go into
>>> the DataSource, it appears to work correctly. When I go into the
>>> datasource, then I just get the hourglass for a very long time (I
>>> will let it continue to run and see if I get a response, it has been
>>> running for over 30 minutes so far).
>>>
>>> If I can get a stacktrace after it blows up, I will create open a bug.
>>>
>>> Thanks for your help.
>>>
>>> David
>>>
>>> Jason Weathersby wrote:
>>>
>>>> David,
>>>
>>>> In 2.3.2 you can set the location of the drivers in the app context,
>>>> but I am not certain this will fix your issue. It should be able to
>>>> load up all the jars in the drivers directory. Can you open a bug
>>>> with the stacktrace you get when trying this method?
>>>
>>>> Jason
>>>
>>>> David Johns wrote:
>>>>> I have a custom JDBC driver that I need to use while creating
>>>>> reports in the BIRT RCP Designer. I have run into two problems
>>>>> depending on the version of BIRT that I am running and I don�¡�
>>>>> t know how to resolve them. I would like to determine a way that
>>>>> would work for both Birt2.2.2 and Birt2.3.2 versions if possible. I
>>>>> am not having a problem when I go to run the reports in my
>>>>> application, as they are embedded in my application and it replaces
>>>>> the data source using a JNDI lookup, so my problem is only when
>>>>> previewing and viewing reports from the BIRT RCP Designer.
>>>>>
>>>>> JDBC Driver Requirements:
>>>>> Main jar: AjJDBC.jar
>>>>> Supporting jars: AjConnectors.jar, wlfullclient.jar, sqljdbc.jar
>>>>>
>>>>> All of these files need to be in the classpath when connecting and
>>>>> querying the data. The driver wraps the normal sql server jdbc
>>>>> driver and makes JEE calls to Weblogic when it intercepts certain
>>>>> data fields being returned in the result set. Also, part of this
>>>>> is using the Java Security Framework (JAAS) to log in to Weblogic.
>>>>>
>>>>> This works fine outside of BIRT when it has everything in it�¡�
>>>>> s class path. However, I am getting class not found errors in BIRT
>>>>> during different circumstances when previewing a report.
>>>>>
>>>>> Problem Summaries:
>>>>> Problem 1: Cannot put all .jar files in �¡K/drivers directory
>>>>> because it causes BIRT to hang when viewing the DataSource because
>>>>> of .jar size (wlfullclient.jar is 56MB).
>>>>>
>>>>> Problem 2: Even if all .jar files are in the ../drivers directory,
>>>>> in Birt 2.2.2 when previewing a report, the ContextClassLoader is a
>>>>> WebApp classloader and the login security has the wrong
>>>>> classloader, so it cannot find and load subject during the login.
>>>>>
>>>>> I can provide a lot more details of what I have tried if you are
>>>>> interested ï¿��ᅵ
>>>>>
>>>>> Requested solution:
>>>>> I am looking for a solution that would let me configure BIRT so
>>>>> that I would not have to modify my jdbc driver, but when Birt was
>>>>> accessing the ODA JDBC data source using my JDBC driver it will
>>>>> have the correct .jar files available to the correct class loader.
>>>>> If that is not possible, then I need to know what the appropriate
>>>>> changes would be to correctly let clients use the BIRT RCP Designer
>>>>> with our JDBC driver.
>>>>>
>>>>> Any help in this would be greatly appreciated.
>>>>>
>>>>>
>>>
>>>
>
>
Re: JDBC Driver classpath in BIRT RCP Designer Problem [message #368686 is a reply to message #368684] Thu, 18 June 2009 19:31 Go to previous messageGo to next message
David Johns is currently offline David JohnsFriend
Messages: 15
Registered: July 2009
Junior Member
Jason,

I am using the ODA_JDBC bridge that comes with the designer.

David

Jason Weathersby wrote:

> David,

> Which ODA are you using to design the reports (Your own or JDBC)?

> Jason

> David Johns wrote:
>> Jason,
>>
>> Sorry about the delays in responses we are just getting out our release,
>> so this was moved down in priority, then put back as my top priority again.
>>
>> I think I might have introduced some confusion in what I am trying to
>> do. I would like to be able to create a set of instructions for report
>> designers that will be using our product on how to configure their BIRT
>> RCP Report Designer. After our clients have created a report, they can
>> then inport the report into our application, and everything is working
>> correctly as we override the DataSource that they configure in the report.
>>
>> However, when designing the report, our JDBC driver needs to connect to
>> the Weblogic 10.3 appserver to resolve some of the data fields (derived
>> fields). Our driver has an option that can be specified to not attempt
>> to resolve these fields and they will return a null (which is what they
>> are doing now). However, our requirement has changed so that now I must
>> provide the values for the derived fields. This is where our driver is
>> having problems when it is attempting to connect to weblogic.
>>
>> So I am trying to create step by step instructions for our clients of
>> what they need to do inside the BIRT RCP Designer to create a valid data
>> source to use while designing the reports. (We replace the datasource
>> inside our App, so it is only for the Report Designer tool that this
>> matters).
>>
>> That being said (sorry it is so verbose), I attempted adding the
>> beforeFactory script that you recommended, and it did not work. I got a
>> java.lang.NoClassDefFoundError when doing a connection test inside the
>> Edit Data Source window.
>>
>> In Birt 2.2.2 I have been able to make some modifications to get items
>> to work, however, I have changed the ContextClassLoader when getting a
>> connection to the class loader of my driver class (and don't change it
>> back). I am not sure what the ramifications of that are so I am trying
>> to handle this properly.
>>
>> Also, I realized if I can connect to the Weblogic DataSource, that
>> should also provide a solution for me. I am having problems doing that,
>> however, I will post that info on a different thread that seems to have
>> a more appropriate title.
>>
>> Thank you for your help and comments.
>>
>> David
>>
>>
>> Jason Weathersby wrote:
>>
>>> David,
>>
>>> Before modifying the app context in your app code try adding the
>>> following to the beforeFactory script of a test report:
>>
>>> reportContext.getAppContext().put("OdaJDBCDriverClassPath",
>>> "C:/apps/apache-tomcat-5.5.20/webapps/2.3rc1/WEB-INF/lib");
>>
>>> Obviously change the path. If this works
>>> Take a look at this blog:
>>>
>>
http://birtworld.blogspot.com/2008/11/birt-connection-poolin g-continued-again.html
>>
>>
>>> If you are using the Viewer and not the API you will can set up the
>>> app context like the following:
>>> 1 - add this like before you launch the viewer in your RCP app
>>
>>> ViewerPlugin.getDefault( ).getPluginPreferences(
>>> ).setValue("APPCONTEXT_EXTENSION_KEY", "MyAppContext");
>>
>>
>>> Implement MyAppContext like:
>>
>>
>>> package org.eclipse.birt.examples.rcpviewer;
>>
>>> import java.util.Map;
>>
>>> import org.eclipse.birt.report.viewer.api.AppContextExtension;
>>
>>> public class MyAppContext extends AppContextExtension{
>>
>>> @Override
>>> public Map getAppContext(Map appContext) {
>>
>>> Map hm = super.getAppContext(appContext);
>>> hm.put("PARENT_CLASSLOADER",
>>> PreviewBirtAction.class.getClassLoader());
>>> //hm.put("webapplication.projectclasspath", "c:/jars/mjo.jar");
>>> //add the jdbc driver path variable mention above here
>>> return hm;
>>
>>> }
>>
>>> @Override
>>> public String getName() {
>>> // TODO Auto-generated method stub
>>> return "MyAppContext";
>>> }
>>
>>> Jason
>>
>>
>>> David Johns wrote:
>>>> Jason,
>>>>
>>>> You indicated that I can set the "app context", can you refer me to
>>>> some documentation on this. (Is there a configuration setting that I
>>>> can make when viewing reports inside Birt RCP?) I must just be
>>>> looking in the wrong spot.
>>>> Also, for 2.3.2 I assume the problem I am having when all of my JDBC
>>>> driver dependencies in the .../driver directory is because it is
>>>> scanning my wlfullclient.jar file to see if it is a JDBC driver
>>>> (since it is in the ../driver directory.) If there is a way to move
>>>> it out of that directory and still have it in the classpath (and
>>>> specifically in the path for the ContextClassloader) I assume that
>>>> should solve the problem.
>>>>
>>>> If I put all of the driver info in the
>>>> ..report.data.oda.jdbc_versionInfo/driver, as long as I don't go into
>>>> the DataSource, it appears to work correctly. When I go into the
>>>> datasource, then I just get the hourglass for a very long time (I
>>>> will let it continue to run and see if I get a response, it has been
>>>> running for over 30 minutes so far).
>>>>
>>>> If I can get a stacktrace after it blows up, I will create open a bug.
>>>>
>>>> Thanks for your help.
>>>>
>>>> David
>>>>
>>>> Jason Weathersby wrote:
>>>>
>>>>> David,
>>>>
>>>>> In 2.3.2 you can set the location of the drivers in the app context,
>>>>> but I am not certain this will fix your issue. It should be able to
>>>>> load up all the jars in the drivers directory. Can you open a bug
>>>>> with the stacktrace you get when trying this method?
>>>>
>>>>> Jason
>>>>
>>>>> David Johns wrote:
>>>>>> I have a custom JDBC driver that I need to use while creating
>>>>>> reports in the BIRT RCP Designer. I have run into two problems
>>>>>> depending on the version of BIRT that I am running and I
donÃᅵ¡Ãᅵ
>>>>>> t know how to resolve them. I would like to determine a way that
>>>>>> would work for both Birt2.2.2 and Birt2.3.2 versions if possible. I
>>>>>> am not having a problem when I go to run the reports in my
>>>>>> application, as they are embedded in my application and it replaces
>>>>>> the data source using a JNDI lookup, so my problem is only when
>>>>>> previewing and viewing reports from the BIRT RCP Designer.
>>>>>>
>>>>>> JDBC Driver Requirements:
>>>>>> Main jar: AjJDBC.jar
>>>>>> Supporting jars: AjConnectors.jar, wlfullclient.jar, sqljdbc.jar
>>>>>>
>>>>>> All of these files need to be in the classpath when connecting and
>>>>>> querying the data. The driver wraps the normal sql server jdbc
>>>>>> driver and makes JEE calls to Weblogic when it intercepts certain
>>>>>> data fields being returned in the result set. Also, part of this
>>>>>> is using the Java Security Framework (JAAS) to log in to Weblogic.
>>>>>>
>>>>>> This works fine outside of BIRT when it has everything in
itÃᅵ¡Ãᅵ
>>>>>> s class path. However, I am getting class not found errors in BIRT
>>>>>> during different circumstances when previewing a report.
>>>>>>
>>>>>> Problem Summaries:
>>>>>> Problem 1: Cannot put all .jar files in Ãᅵ¡K/drivers directory
>>>>>> because it causes BIRT to hang when viewing the DataSource because
>>>>>> of .jar size (wlfullclient.jar is 56MB).
>>>>>>
>>>>>> Problem 2: Even if all .jar files are in the ../drivers directory,
>>>>>> in Birt 2.2.2 when previewing a report, the ContextClassLoader is a
>>>>>> WebApp classloader and the login security has the wrong
>>>>>> classloader, so it cannot find and load subject during the login.
>>>>>>
>>>>>> I can provide a lot more details of what I have tried if you are
>>>>>> interested ï¿ÅᅵÃᅵï¿œ
>>>>>>
>>>>>> Requested solution:
>>>>>> I am looking for a solution that would let me configure BIRT so
>>>>>> that I would not have to modify my jdbc driver, but when Birt was
>>>>>> accessing the ODA JDBC data source using my JDBC driver it will
>>>>>> have the correct .jar files available to the correct class loader.
>>>>>> If that is not possible, then I need to know what the appropriate
>>>>>> changes would be to correctly let clients use the BIRT RCP Designer
>>>>>> with our JDBC driver.
>>>>>>
>>>>>> Any help in this would be greatly appreciated.
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Re: JDBC Driver classpath in BIRT RCP Designer Problem [message #368697 is a reply to message #368686] Fri, 19 June 2009 01:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

David,

I assume you mean just the JDBC ODA. The DTP project does support a
Bridge extension which is somewhat different. In the designer the user
has to specify what class is used to connect when using the JDBC plugin.
Which one are are you specifying (Apart from the issue you are having
with JNDI).

On the JNDI issue that should be working. I am still looking at it.

Jason

David Johns wrote:
> Jason,
>
> I am using the ODA_JDBC bridge that comes with the designer.
>
> David
>
> Jason Weathersby wrote:
>
>> David,
>
>> Which ODA are you using to design the reports (Your own or JDBC)?
>
>> Jason
>
>> David Johns wrote:
>>> Jason,
>>>
>>> Sorry about the delays in responses we are just getting out our
>>> release, so this was moved down in priority, then put back as my top
>>> priority again.
>>>
>>> I think I might have introduced some confusion in what I am trying to
>>> do. I would like to be able to create a set of instructions for
>>> report designers that will be using our product on how to configure
>>> their BIRT RCP Report Designer. After our clients have created a
>>> report, they can then inport the report into our application, and
>>> everything is working correctly as we override the DataSource that
>>> they configure in the report.
>>>
>>> However, when designing the report, our JDBC driver needs to connect
>>> to the Weblogic 10.3 appserver to resolve some of the data fields
>>> (derived fields). Our driver has an option that can be specified to
>>> not attempt to resolve these fields and they will return a null
>>> (which is what they are doing now). However, our requirement has
>>> changed so that now I must provide the values for the derived fields.
>>> This is where our driver is having problems when it is attempting to
>>> connect to weblogic.
>>>
>>> So I am trying to create step by step instructions for our clients of
>>> what they need to do inside the BIRT RCP Designer to create a valid
>>> data source to use while designing the reports. (We replace the
>>> datasource inside our App, so it is only for the Report Designer tool
>>> that this matters).
>>>
>>> That being said (sorry it is so verbose), I attempted adding the
>>> beforeFactory script that you recommended, and it did not work. I
>>> got a java.lang.NoClassDefFoundError when doing a connection test
>>> inside the Edit Data Source window.
>>>
>>> In Birt 2.2.2 I have been able to make some modifications to get
>>> items to work, however, I have changed the ContextClassLoader when
>>> getting a connection to the class loader of my driver class (and
>>> don't change it back). I am not sure what the ramifications of that
>>> are so I am trying to handle this properly.
>>>
>>> Also, I realized if I can connect to the Weblogic DataSource, that
>>> should also provide a solution for me. I am having problems doing
>>> that, however, I will post that info on a different thread that seems
>>> to have a more appropriate title.
>>>
>>> Thank you for your help and comments.
>>>
>>> David
>>>
>>>
>>> Jason Weathersby wrote:
>>>
>>>> David,
>>>
>>>> Before modifying the app context in your app code try adding the
>>>> following to the beforeFactory script of a test report:
>>>
>>>> reportContext.getAppContext().put("OdaJDBCDriverClassPath",
>>>> "C:/apps/apache-tomcat-5.5.20/webapps/2.3rc1/WEB-INF/lib");
>>>
>>>> Obviously change the path. If this works
>>>> Take a look at this blog:
>>>>
>>>
> http://birtworld.blogspot.com/2008/11/birt-connection-poolin g-continued-again.html
>
>>>
>>>
>>>> If you are using the Viewer and not the API you will can set up the
>>>> app context like the following:
>>>> 1 - add this like before you launch the viewer in your RCP app
>>>
>>>> ViewerPlugin.getDefault( ).getPluginPreferences(
>>>> ).setValue("APPCONTEXT_EXTENSION_KEY", "MyAppContext");
>>>
>>>
>>>> Implement MyAppContext like:
>>>
>>>
>>>> package org.eclipse.birt.examples.rcpviewer;
>>>
>>>> import java.util.Map;
>>>
>>>> import org.eclipse.birt.report.viewer.api.AppContextExtension;
>>>
>>>> public class MyAppContext extends AppContextExtension{
>>>
>>>> @Override
>>>> public Map getAppContext(Map appContext) {
>>>
>>>> Map hm = super.getAppContext(appContext);
>>>> hm.put("PARENT_CLASSLOADER",
>>>> PreviewBirtAction.class.getClassLoader());
>>>> //hm.put("webapplication.projectclasspath", "c:/jars/mjo.jar");
>>>> //add the jdbc driver path variable mention above here
>>>> return hm;
>>>
>>>> }
>>>
>>>> @Override
>>>> public String getName() {
>>>> // TODO Auto-generated method stub
>>>> return "MyAppContext";
>>>> }
>>>
>>>> Jason
>>>
>>>
>>>> David Johns wrote:
>>>>> Jason,
>>>>>
>>>>> You indicated that I can set the "app context", can you refer me to
>>>>> some documentation on this. (Is there a configuration setting that
>>>>> I can make when viewing reports inside Birt RCP?) I must just be
>>>>> looking in the wrong spot.
>>>>> Also, for 2.3.2 I assume the problem I am having when all of my
>>>>> JDBC driver dependencies in the .../driver directory is because it
>>>>> is scanning my wlfullclient.jar file to see if it is a JDBC driver
>>>>> (since it is in the ../driver directory.) If there is a way to
>>>>> move it out of that directory and still have it in the classpath
>>>>> (and specifically in the path for the ContextClassloader) I assume
>>>>> that should solve the problem.
>>>>>
>>>>> If I put all of the driver info in the
>>>>> ..report.data.oda.jdbc_versionInfo/driver, as long as I don't go
>>>>> into the DataSource, it appears to work correctly. When I go into
>>>>> the datasource, then I just get the hourglass for a very long time
>>>>> (I will let it continue to run and see if I get a response, it has
>>>>> been running for over 30 minutes so far).
>>>>>
>>>>> If I can get a stacktrace after it blows up, I will create open a bug.
>>>>>
>>>>> Thanks for your help.
>>>>>
>>>>> David
>>>>>
>>>>> Jason Weathersby wrote:
>>>>>
>>>>>> David,
>>>>>
>>>>>> In 2.3.2 you can set the location of the drivers in the app
>>>>>> context, but I am not certain this will fix your issue. It should
>>>>>> be able to load up all the jars in the drivers directory. Can you
>>>>>> open a bug with the stacktrace you get when trying this method?
>>>>>
>>>>>> Jason
>>>>>
>>>>>> David Johns wrote:
>>>>>>> I have a custom JDBC driver that I need to use while creating
>>>>>>> reports in the BIRT RCP Designer. I have run into two problems
>>>>>>> depending on the version of BIRT that I am running and I
> don�ᅵ�¡�ᅵ
>>>>>>> t know how to resolve them. I would like to determine a way that
>>>>>>> would work for both Birt2.2.2 and Birt2.3.2 versions if possible.
>>>>>>> I am not having a problem when I go to run the reports in my
>>>>>>> application, as they are embedded in my application and it
>>>>>>> replaces the data source using a JNDI lookup, so my problem is
>>>>>>> only when previewing and viewing reports from the BIRT RCP Designer.
>>>>>>>
>>>>>>> JDBC Driver Requirements:
>>>>>>> Main jar: AjJDBC.jar
>>>>>>> Supporting jars: AjConnectors.jar, wlfullclient.jar, sqljdbc.jar
>>>>>>>
>>>>>>> All of these files need to be in the classpath when connecting
>>>>>>> and querying the data. The driver wraps the normal sql server
>>>>>>> jdbc driver and makes JEE calls to Weblogic when it intercepts
>>>>>>> certain data fields being returned in the result set. Also, part
>>>>>>> of this is using the Java Security Framework (JAAS) to log in to
>>>>>>> Weblogic.
>>>>>>>
>>>>>>> This works fine outside of BIRT when it has everything in
> it�ᅵ�¡�ᅵ
>>>>>>> s class path. However, I am getting class not found errors in
>>>>>>> BIRT during different circumstances when previewing a report.
>>>>>>>
>>>>>>> Problem Summaries:
>>>>>>> Problem 1: Cannot put all .jar files in �ᅵ�¡K/drivers
>>>>>>> directory because it causes BIRT to hang when viewing the
>>>>>>> DataSource because of .jar size (wlfullclient.jar is 56MB).
>>>>>>>
>>>>>>> Problem 2: Even if all .jar files are in the ../drivers
>>>>>>> directory, in Birt 2.2.2 when previewing a report, the
>>>>>>> ContextClassLoader is a WebApp classloader and the login security
>>>>>>> has the wrong classloader, so it cannot find and load subject
>>>>>>> during the login.
>>>>>>>
>>>>>>> I can provide a lot more details of what I have tried if you are
>>>>>>> interested �¯�¿�ᅵ�ᅵï¿�
>>>>>>>
>>>>>>> Requested solution:
>>>>>>> I am looking for a solution that would let me configure BIRT so
>>>>>>> that I would not have to modify my jdbc driver, but when Birt was
>>>>>>> accessing the ODA JDBC data source using my JDBC driver it will
>>>>>>> have the correct .jar files available to the correct class
>>>>>>> loader. If that is not possible, then I need to know what the
>>>>>>> appropriate changes would be to correctly let clients use the
>>>>>>> BIRT RCP Designer with our JDBC driver.
>>>>>>>
>>>>>>> Any help in this would be greatly appreciated.
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Re: JDBC Driver classpath in BIRT RCP Designer Problem [message #368707 is a reply to message #368697] Fri, 19 June 2009 15:28 Go to previous messageGo to next message
David Johns is currently offline David JohnsFriend
Messages: 15
Registered: July 2009
Junior Member
Jason,

You are correct in your assumption. I have put our custom JDBC Driver in
that directory (it is a wrapper for a MS SQL Server JDBC driver with some
customization to handle the processing of our derived fields. Our driver
has a dependency on three other .jar's. One is sqljdbc.jar (MS Sql's
JDBC), we have a custom AjConnectors.jar that we use to connect to the
specific app server, and the wlfullclient.jar (weblogic's full client jar)
which is the one that is very large.

To get the birt 2.2.2 to work I added a manifest entry in our driver jar
to point to a "./lib/AjConnectors.jar" and it has a manifest entry that
points to "wlfullclient.jar". I put the jars in the following structure:

.../org.eclipse.birt.report.data.oda.jdbc_<ver>/drivers
AjDriver.jar
sqljdbc.jar
/lib
AjConnectors.jar
wlfullclient.jar

This seemed to solve the problem except when logging in to make a call to
the appserver, the java security classes switch and use the context class
loader which is the webapp viewer (in some cases) and the login fails with
a class not found exception. So it worked when doing a DataSet preview
because it was using the ODA datasource, but it failed when using the
viewer as it was using the webapp viewer class loader. (Didn't remember
the correct names of the class loaders, but that was the general idea).

In birt 2.3.2 when I put the .jar files in the above configuration, it
appears that the classloader does not find the relationship to the
AjConnectors.jar file when doing a test connection (I am getting a class
not found exception for one of the classes in the AjConnectors.jar.

So I am hoping that I am just going about setting up everything wrong, and
once I figure it out it will all work nicely ;-)

I had one other anomoly on the JNDI issue, I will add a note to that
thread.

Here is the stack trace that I got when running the Birt 2.3.2 with the
configuration as stated above. The
com.cu.ajility.appserver.exception.ConnectorServiceNotFoundE xception class
is in the AjConnectors.jar file.

!SESSION 2009-06-19 08:13:51.368
-----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_07
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86

!ENTRY org.eclipse.ui 4 0 2009-06-19 08:14:14.305
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NoClassDefFoundError:
com/cu/ajility/appserver/exception/ConnectorServiceNotFoundE xception
at
com.cu.ajent.sql.AjConnection.getJdbcServiceDelegate(AjConne ction.java:953)
at com.cu.ajent.sql.AjDriver.connect(AjDriver.java:342)
at
org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager$Wrap pedDriver.connect(JDBCDriverManager.java:1082)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at
org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.doCo nnect(JDBCDriverManager.java:218)
at
org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.getC onnection(JDBCDriverManager.java:153)
at
org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.tryC reateConnection(JDBCDriverManager.java:654)
at
org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.test Connection(JDBCDriverManager.java:560)
at
org.eclipse.birt.report.data.oda.jdbc.ui.util.DriverLoader.t estConnection(DriverLoader.java:118)
at
org.eclipse.birt.report.data.oda.jdbc.ui.profile.JDBCSelecti onPageHelper.testConnection(JDBCSelectionPageHelper.java:635 )
at
org.eclipse.birt.report.data.oda.jdbc.ui.profile.JDBCSelecti onPageHelper.access$7(JDBCSelectionPageHelper.java:619)
at
org.eclipse.birt.report.data.oda.jdbc.ui.profile.JDBCSelecti onPageHelper$7.widgetSelected(JDBCSelectionPageHelper.java:5 41)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at
org.eclipse.birt.report.designer.internal.ui.dialogs.BaseDia log.open(BaseDialog.java:112)
at
org.eclipse.birt.report.designer.internal.ui.views.data.prov iders.DataSourceNodeProvider.performEdit(DataSourceNodeProvi der.java:88)
at
org.eclipse.birt.report.designer.internal.ui.views.DefaultNo deProvider.performRequest(DefaultNodeProvider.java:410)
at
org.eclipse.birt.report.designer.internal.ui.views.actions.E ditAction.doAction(EditAction.java:85)
at
org.eclipse.birt.report.designer.internal.ui.views.actions.A bstractElementAction.run(AbstractElementAction.java:66)
at
org.eclipse.birt.report.designer.internal.ui.views.RenameLis tener.doubleClick(RenameListener.java:214)
at
org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredV iewer.java:799)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(S tructuredViewer.java:797)
at
org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSel ect(AbstractTreeViewer.java:1419)
at
org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSe lected(StructuredViewer.java:1173)
at
org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEven t(OpenStrategy.java:237)
at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.ja va:234)
at
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:295)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 00)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.birt.report.designer.ui.rcp.DesignerApplication. run(DesignerApplication.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hodWithException(EclipseAppContainer.java:574)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:195)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Caused by: java.lang.ClassNotFoundException:
com.cu.ajility.appserver.exception.ConnectorServiceNotFoundE xception
at
org.eclipse.birt.core.framework.URLClassLoader.findClass(URL ClassLoader.java:159)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 66 more


Jason Weathersby wrote:

> David,

> I assume you mean just the JDBC ODA. The DTP project does support a
> Bridge extension which is somewhat different. In the designer the user
> has to specify what class is used to connect when using the JDBC plugin.
> Which one are are you specifying (Apart from the issue you are having
> with JNDI).

> On the JNDI issue that should be working. I am still looking at it.

> Jason

> David Johns wrote:
>> Jason,
>>
>> I am using the ODA_JDBC bridge that comes with the designer.
>>
>> David
>>
>> Jason Weathersby wrote:
>>
>>> David,
>>
>>> Which ODA are you using to design the reports (Your own or JDBC)?
>>
>>> Jason
>>
>>> David Johns wrote:
>>>> Jason,
>>>>
>>>> Sorry about the delays in responses we are just getting out our
>>>> release, so this was moved down in priority, then put back as my top
>>>> priority again.
>>>>
>>>> I think I might have introduced some confusion in what I am trying to
>>>> do. I would like to be able to create a set of instructions for
>>>> report designers that will be using our product on how to configure
>>>> their BIRT RCP Report Designer. After our clients have created a
>>>> report, they can then inport the report into our application, and
>>>> everything is working correctly as we override the DataSource that
>>>> they configure in the report.
>>>>
>>>> However, when designing the report, our JDBC driver needs to connect
>>>> to the Weblogic 10.3 appserver to resolve some of the data fields
>>>> (derived fields). Our driver has an option that can be specified to
>>>> not attempt to resolve these fields and they will return a null
>>>> (which is what they are doing now). However, our requirement has
>>>> changed so that now I must provide the values for the derived fields.
>>>> This is where our driver is having problems when it is attempting to
>>>> connect to weblogic.
>>>>
>>>> So I am trying to create step by step instructions for our clients of
>>>> what they need to do inside the BIRT RCP Designer to create a valid
>>>> data source to use while designing the reports. (We replace the
>>>> datasource inside our App, so it is only for the Report Designer tool
>>>> that this matters).
>>>>
>>>> That being said (sorry it is so verbose), I attempted adding the
>>>> beforeFactory script that you recommended, and it did not work. I
>>>> got a java.lang.NoClassDefFoundError when doing a connection test
>>>> inside the Edit Data Source window.
>>>>
>>>> In Birt 2.2.2 I have been able to make some modifications to get
>>>> items to work, however, I have changed the ContextClassLoader when
>>>> getting a connection to the class loader of my driver class (and
>>>> don't change it back). I am not sure what the ramifications of that
>>>> are so I am trying to handle this properly.
>>>>
>>>> Also, I realized if I can connect to the Weblogic DataSource, that
>>>> should also provide a solution for me. I am having problems doing
>>>> that, however, I will post that info on a different thread that seems
>>>> to have a more appropriate title.
>>>>
>>>> Thank you for your help and comments.
>>>>
>>>> David
>>>>
>>>>
>>>> Jason Weathersby wrote:
>>>>
>>>>> David,
>>>>
>>>>> Before modifying the app context in your app code try adding the
>>>>> following to the beforeFactory script of a test report:
>>>>
>>>>> reportContext.getAppContext().put("OdaJDBCDriverClassPath",
>>>>> "C:/apps/apache-tomcat-5.5.20/webapps/2.3rc1/WEB-INF/lib");
>>>>
>>>>> Obviously change the path. If this works
>>>>> Take a look at this blog:
>>>>>
>>>>
>>
http://birtworld.blogspot.com/2008/11/birt-connection-poolin g-continued-again.html
>>
>>>>
>>>>
>>>>> If you are using the Viewer and not the API you will can set up the
>>>>> app context like the following:
>>>>> 1 - add this like before you launch the viewer in your RCP app
>>>>
>>>>> ViewerPlugin.getDefault( ).getPluginPreferences(
>>>>> ).setValue("APPCONTEXT_EXTENSION_KEY", "MyAppContext");
>>>>
>>>>
>>>>> Implement MyAppContext like:
>>>>
>>>>
>>>>> package org.eclipse.birt.examples.rcpviewer;
>>>>
>>>>> import java.util.Map;
>>>>
>>>>> import org.eclipse.birt.report.viewer.api.AppContextExtension;
>>>>
>>>>> public class MyAppContext extends AppContextExtension{
>>>>
>>>>> @Override
>>>>> public Map getAppContext(Map appContext) {
>>>>
>>>>> Map hm = super.getAppContext(appContext);
>>>>> hm.put("PARENT_CLASSLOADER",
>>>>> PreviewBirtAction.class.getClassLoader());
>>>>> //hm.put("webapplication.projectclasspath", "c:/jars/mjo.jar");
>>>>> //add the jdbc driver path variable mention above here
>>>>> return hm;
>>>>
>>>>> }
>>>>
>>>>> @Override
>>>>> public String getName() {
>>>>> // TODO Auto-generated method stub
>>>>> return "MyAppContext";
>>>>> }
>>>>
>>>>> Jason
>>>>
>>>>
>>>>> David Johns wrote:
>>>>>> Jason,
>>>>>>
>>>>>> You indicated that I can set the "app context", can you refer me to
>>>>>> some documentation on this. (Is there a configuration setting that
>>>>>> I can make when viewing reports inside Birt RCP?) I must just be
>>>>>> looking in the wrong spot.
>>>>>> Also, for 2.3.2 I assume the problem I am having when all of my
>>>>>> JDBC driver dependencies in the .../driver directory is because it
>>>>>> is scanning my wlfullclient.jar file to see if it is a JDBC driver
>>>>>> (since it is in the ../driver directory.) If there is a way to
>>>>>> move it out of that directory and still have it in the classpath
>>>>>> (and specifically in the path for the ContextClassloader) I assume
>>>>>> that should solve the problem.
>>>>>>
>>>>>> If I put all of the driver info in the
>>>>>> ..report.data.oda.jdbc_versionInfo/driver, as long as I don't go
>>>>>> into the DataSource, it appears to work correctly. When I go into
>>>>>> the datasource, then I just get the hourglass for a very long time
>>>>>> (I will let it continue to run and see if I get a response, it has
>>>>>> been running for over 30 minutes so far).
>>>>>>
>>>>>> If I can get a stacktrace after it blows up, I will create open a bug.
>>>>>>
>>>>>> Thanks for your help.
>>>>>>
>>>>>> David
>>>>>>
>>>>>> Jason Weathersby wrote:
>>>>>>
>>>>>>> David,
>>>>>>
>>>>>>> In 2.3.2 you can set the location of the drivers in the app
>>>>>>> context, but I am not certain this will fix your issue. It should
>>>>>>> be able to load up all the jars in the drivers directory. Can you
>>>>>>> open a bug with the stacktrace you get when trying this method?
>>>>>>
>>>>>>> Jason
>>>>>>
>>>>>>> David Johns wrote:
>>>>>>>> I have a custom JDBC driver that I need to use while creating
>>>>>>>> reports in the BIRT RCP Designer. I have run into two problems
>>>>>>>> depending on the version of BIRT that I am running and I
>>>>>>>> dont know how to resolve them. I would like to determine a way that
>>>>>>>> would work for both Birt2.2.2 and Birt2.3.2 versions if possible.
>>>>>>>> I am not having a problem when I go to run the reports in my
>>>>>>>> application, as they are embedded in my application and it
>>>>>>>> replaces the data source using a JNDI lookup, so my problem is
>>>>>>>> only when previewing and viewing reports from the BIRT RCP Designer.
>>>>>>>>
>>>>>>>> JDBC Driver Requirements:
>>>>>>>> Main jar: AjJDBC.jar
>>>>>>>> Supporting jars: AjConnectors.jar, wlfullclient.jar, sqljdbc.jar
>>>>>>>>
>>>>>>>> All of these files need to be in the classpath when connecting
>>>>>>>> and querying the data. The driver wraps the normal sql server
>>>>>>>> jdbc driver and makes JEE calls to Weblogic when it intercepts
>>>>>>>> certain data fields being returned in the result set. Also, part
>>>>>>>> of this is using the Java Security Framework (JAAS) to log in to
>>>>>>>> Weblogic.
>>>>>>>>
>>>>>>>> This works fine outside of BIRT when it has everything in
>>>>>>>> its class path. However, I am getting class not found errors in
>>>>>>>> BIRT during different circumstances when previewing a report.
>>>>>>>>
>>>>>>>> Problem Summaries:
>>>>>>>> Problem 1: Cannot put all .jar files in ../drivers
>>>>>>>> directory because it causes BIRT to hang when viewing the
>>>>>>>> DataSource because of .jar size (wlfullclient.jar is 56MB).
>>>>>>>>
>>>>>>>> Problem 2: Even if all .jar files are in the ../drivers
>>>>>>>> directory, in Birt 2.2.2 when previewing a report, the
>>>>>>>> ContextClassLoader is a WebApp classloader and the login security
>>>>>>>> has the wrong classloader, so it cannot find and load subject
>>>>>>>> during the login.
>>>>>>>>
>>>>>>>> I can provide a lot more details of what I have tried if you are
>>>>>>>> interested
>>>>>>>>
>>>>>>>> Requested solution:
>>>>>>>> I am looking for a solution that would let me configure BIRT so
>>>>>>>> that I would not have to modify my jdbc driver, but when Birt was
>>>>>>>> accessing the ODA JDBC data source using my JDBC driver it will
>>>>>>>> have the correct .jar files available to the correct class
>>>>>>>> loader. If that is not possible, then I need to know what the
>>>>>>>> appropriate changes would be to correctly let clients use the
>>>>>>>> BIRT RCP Designer with our JDBC driver.
>>>>>>>>
>>>>>>>> Any help in this would be greatly appreciated.
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
Re: JDBC Driver classpath in BIRT RCP Designer Problem [message #368719 is a reply to message #368707] Sat, 20 June 2009 05:30 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

David,

If you have added it to the manifest it should be picking it up. You
may get this error if you have more than one copy in your cp.
I wish I had wl here to test it.

Jason

David Johns wrote:
> Jason,
>
> You are correct in your assumption. I have put our custom JDBC Driver
> in that directory (it is a wrapper for a MS SQL Server JDBC driver with
> some customization to handle the processing of our derived fields. Our
> driver has a dependency on three other .jar's. One is sqljdbc.jar (MS
> Sql's JDBC), we have a custom AjConnectors.jar that we use to connect to
> the specific app server, and the wlfullclient.jar (weblogic's full
> client jar) which is the one that is very large.
>
> To get the birt 2.2.2 to work I added a manifest entry in our driver jar
> to point to a "./lib/AjConnectors.jar" and it has a manifest entry that
> points to "wlfullclient.jar". I put the jars in the following structure:
>
> ../org.eclipse.birt.report.data.oda.jdbc_<ver>/drivers
> AjDriver.jar
> sqljdbc.jar
> /lib
> AjConnectors.jar
> wlfullclient.jar
>
> This seemed to solve the problem except when logging in to make a call
> to the appserver, the java security classes switch and use the context
> class loader which is the webapp viewer (in some cases) and the login
> fails with a class not found exception. So it worked when doing a
> DataSet preview because it was using the ODA datasource, but it failed
> when using the viewer as it was using the webapp viewer class loader.
> (Didn't remember the correct names of the class loaders, but that was
> the general idea).
>
> In birt 2.3.2 when I put the .jar files in the above configuration, it
> appears that the classloader does not find the relationship to the
> AjConnectors.jar file when doing a test connection (I am getting a class
> not found exception for one of the classes in the AjConnectors.jar.
>
> So I am hoping that I am just going about setting up everything wrong,
> and once I figure it out it will all work nicely ;-)
>
> I had one other anomoly on the JNDI issue, I will add a note to that
> thread.
>
> Here is the stack trace that I got when running the Birt 2.3.2 with the
> configuration as stated above. The
> com.cu.ajility.appserver.exception.ConnectorServiceNotFoundE xception
> class is in the AjConnectors.jar file.
>
> !SESSION 2009-06-19 08:13:51.368
> -----------------------------------------------
> eclipse.buildId=unknown
> java.version=1.6.0_07
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Command-line arguments: -os win32 -ws win32 -arch x86
>
> !ENTRY org.eclipse.ui 4 0 2009-06-19 08:14:14.305
> !MESSAGE Unhandled event loop exception
> !STACK 0
> java.lang.NoClassDefFoundError:
> com/cu/ajility/appserver/exception/ConnectorServiceNotFoundE xception
> at
> com.cu.ajent.sql.AjConnection.getJdbcServiceDelegate(AjConne ction.java:953)
> at com.cu.ajent.sql.AjDriver.connect(AjDriver.java:342)
> at
> org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager$Wrap pedDriver.connect(JDBCDriverManager.java:1082)
>
> at java.sql.DriverManager.getConnection(Unknown Source)
> at java.sql.DriverManager.getConnection(Unknown Source)
> at
> org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.doCo nnect(JDBCDriverManager.java:218)
>
> at
> org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.getC onnection(JDBCDriverManager.java:153)
>
> at
> org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.tryC reateConnection(JDBCDriverManager.java:654)
>
> at
> org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.test Connection(JDBCDriverManager.java:560)
>
> at
> org.eclipse.birt.report.data.oda.jdbc.ui.util.DriverLoader.t estConnection(DriverLoader.java:118)
>
> at
> org.eclipse.birt.report.data.oda.jdbc.ui.profile.JDBCSelecti onPageHelper.testConnection(JDBCSelectionPageHelper.java:635 )
>
> at
> org.eclipse.birt.report.data.oda.jdbc.ui.profile.JDBCSelecti onPageHelper.access$7(JDBCSelectionPageHelper.java:619)
>
> at
> org.eclipse.birt.report.data.oda.jdbc.ui.profile.JDBCSelecti onPageHelper$7.widgetSelected(JDBCSelectionPageHelper.java:5 41)
>
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
> at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
> at org.eclipse.jface.window.Window.open(Window.java:801)
> at
> org.eclipse.birt.report.designer.internal.ui.dialogs.BaseDia log.open(BaseDialog.java:112)
>
> at
> org.eclipse.birt.report.designer.internal.ui.views.data.prov iders.DataSourceNodeProvider.performEdit(DataSourceNodeProvi der.java:88)
>
> at
> org.eclipse.birt.report.designer.internal.ui.views.DefaultNo deProvider.performRequest(DefaultNodeProvider.java:410)
>
> at
> org.eclipse.birt.report.designer.internal.ui.views.actions.E ditAction.doAction(EditAction.java:85)
>
> at
> org.eclipse.birt.report.designer.internal.ui.views.actions.A bstractElementAction.run(AbstractElementAction.java:66)
>
> at
> org.eclipse.birt.report.designer.internal.ui.views.RenameLis tener.doubleClick(RenameListener.java:214)
>
> at
> org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredV iewer.java:799)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:880)
> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
> at
> org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(S tructuredViewer.java:797)
>
> at
> org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSel ect(AbstractTreeViewer.java:1419)
>
> at
> org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSe lected(StructuredViewer.java:1173)
>
> at
> org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEven t(OpenStrategy.java:237)
>
> at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.ja va:234)
> at
> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:295)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2384)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 00)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:490)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.birt.report.designer.ui.rcp.DesignerApplication. run(DesignerApplication.java:38)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hodWithException(EclipseAppContainer.java:574)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:195)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
> Caused by: java.lang.ClassNotFoundException:
> com.cu.ajility.appserver.exception.ConnectorServiceNotFoundE xception
> at
> org.eclipse.birt.core.framework.URLClassLoader.findClass(URL ClassLoader.java:159)
>
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> ... 66 more
>
>
> Jason Weathersby wrote:
>
>> David,
>
>> I assume you mean just the JDBC ODA. The DTP project does support a
>> Bridge extension which is somewhat different. In the designer the
>> user has to specify what class is used to connect when using the JDBC
>> plugin. Which one are are you specifying (Apart from the issue you
>> are having with JNDI).
>
>> On the JNDI issue that should be working. I am still looking at it.
>
>> Jason
>
>> David Johns wrote:
>>> Jason,
>>>
>>> I am using the ODA_JDBC bridge that comes with the designer.
>>>
>>> David
>>>
>>> Jason Weathersby wrote:
>>>
>>>> David,
>>>
>>>> Which ODA are you using to design the reports (Your own or JDBC)?
>>>
>>>> Jason
>>>
>>>> David Johns wrote:
>>>>> Jason,
>>>>>
>>>>> Sorry about the delays in responses we are just getting out our
>>>>> release, so this was moved down in priority, then put back as my
>>>>> top priority again.
>>>>>
>>>>> I think I might have introduced some confusion in what I am trying
>>>>> to do. I would like to be able to create a set of instructions for
>>>>> report designers that will be using our product on how to configure
>>>>> their BIRT RCP Report Designer. After our clients have created a
>>>>> report, they can then inport the report into our application, and
>>>>> everything is working correctly as we override the DataSource that
>>>>> they configure in the report.
>>>>>
>>>>> However, when designing the report, our JDBC driver needs to
>>>>> connect to the Weblogic 10.3 appserver to resolve some of the data
>>>>> fields (derived fields). Our driver has an option that can be
>>>>> specified to not attempt to resolve these fields and they will
>>>>> return a null (which is what they are doing now). However, our
>>>>> requirement has changed so that now I must provide the values for
>>>>> the derived fields. This is where our driver is having problems
>>>>> when it is attempting to connect to weblogic.
>>>>>
>>>>> So I am trying to create step by step instructions for our clients
>>>>> of what they need to do inside the BIRT RCP Designer to create a
>>>>> valid data source to use while designing the reports. (We replace
>>>>> the datasource inside our App, so it is only for the Report
>>>>> Designer tool that this matters).
>>>>>
>>>>> That being said (sorry it is so verbose), I attempted adding the
>>>>> beforeFactory script that you recommended, and it did not work. I
>>>>> got a java.lang.NoClassDefFoundError when doing a connection test
>>>>> inside the Edit Data Source window.
>>>>>
>>>>> In Birt 2.2.2 I have been able to make some modifications to get
>>>>> items to work, however, I have changed the ContextClassLoader when
>>>>> getting a connection to the class loader of my driver class (and
>>>>> don't change it back). I am not sure what the ramifications of that
>>>>> are so I am trying to handle this properly.
>>>>>
>>>>> Also, I realized if I can connect to the Weblogic DataSource, that
>>>>> should also provide a solution for me. I am having problems doing
>>>>> that, however, I will post that info on a different thread that
>>>>> seems to have a more appropriate title.
>>>>>
>>>>> Thank you for your help and comments.
>>>>>
>>>>> David
>>>>>
>>>>>
>>>>> Jason Weathersby wrote:
>>>>>
>>>>>> David,
>>>>>
>>>>>> Before modifying the app context in your app code try adding the
>>>>>> following to the beforeFactory script of a test report:
>>>>>
>>>>>> reportContext.getAppContext().put("OdaJDBCDriverClassPath",
>>>>>> "C:/apps/apache-tomcat-5.5.20/webapps/2.3rc1/WEB-INF/lib");
>>>>>
>>>>>> Obviously change the path. If this works
>>>>>> Take a look at this blog:
>>>>>>
>>>>>
>>>
> http://birtworld.blogspot.com/2008/11/birt-connection-poolin g-continued-again.html
>
>>>
>>>>>
>>>>>
>>>>>> If you are using the Viewer and not the API you will can set up
>>>>>> the app context like the following:
>>>>>> 1 - add this like before you launch the viewer in your RCP app
>>>>>
>>>>>> ViewerPlugin.getDefault( ).getPluginPreferences(
>>>>>> ).setValue("APPCONTEXT_EXTENSION_KEY", "MyAppContext");
>>>>>
>>>>>
>>>>>> Implement MyAppContext like:
>>>>>
>>>>>
>>>>>> package org.eclipse.birt.examples.rcpviewer;
>>>>>
>>>>>> import java.util.Map;
>>>>>
>>>>>> import org.eclipse.birt.report.viewer.api.AppContextExtension;
>>>>>
>>>>>> public class MyAppContext extends AppContextExtension{
>>>>>
>>>>>> @Override
>>>>>> public Map getAppContext(Map appContext) {
>>>>>
>>>>>> Map hm = super.getAppContext(appContext);
>>>>>> hm.put("PARENT_CLASSLOADER",
>>>>>> PreviewBirtAction.class.getClassLoader());
>>>>>> //hm.put("webapplication.projectclasspath",
>>>>>> "c:/jars/mjo.jar");
>>>>>> //add the jdbc driver path variable mention above here
>>>>>> return hm;
>>>>>
>>>>>> }
>>>>>
>>>>>> @Override
>>>>>> public String getName() {
>>>>>> // TODO Auto-generated method stub
>>>>>> return "MyAppContext";
>>>>>> }
>>>>>
>>>>>> Jason
>>>>>
>>>>>
>>>>>> David Johns wrote:
>>>>>>> Jason,
>>>>>>>
>>>>>>> You indicated that I can set the "app context", can you refer me
>>>>>>> to some documentation on this. (Is there a configuration setting
>>>>>>> that I can make when viewing reports inside Birt RCP?) I must
>>>>>>> just be looking in the wrong spot.
>>>>>>> Also, for 2.3.2 I assume the problem I am having when all of my
>>>>>>> JDBC driver dependencies in the .../driver directory is because
>>>>>>> it is scanning my wlfullclient.jar file to see if it is a JDBC
>>>>>>> driver (since it is in the ../driver directory.) If there is a
>>>>>>> way to move it out of that directory and still have it in the
>>>>>>> classpath (and specifically in the path for the
>>>>>>> ContextClassloader) I assume that should solve the problem.
>>>>>>>
>>>>>>> If I put all of the driver info in the
>>>>>>> ..report.data.oda.jdbc_versionInfo/driver, as long as I don't go
>>>>>>> into the DataSource, it appears to work correctly. When I go
>>>>>>> into the datasource, then I just get the hourglass for a very
>>>>>>> long time (I will let it continue to run and see if I get a
>>>>>>> response, it has been running for over 30 minutes so far).
>>>>>>>
>>>>>>> If I can get a stacktrace after it blows up, I will create open a
>>>>>>> bug.
>>>>>>>
>>>>>>> Thanks for your help.
>>>>>>>
>>>>>>> David
>>>>>>>
>>>>>>> Jason Weathersby wrote:
>>>>>>>
>>>>>>>> David,
>>>>>>>
>>>>>>>> In 2.3.2 you can set the location of the drivers in the app
>>>>>>>> context, but I am not certain this will fix your issue. It
>>>>>>>> should be able to load up all the jars in the drivers
>>>>>>>> directory. Can you open a bug with the stacktrace you get when
>>>>>>>> trying this method?
>>>>>>>
>>>>>>>> Jason
>>>>>>>
>>>>>>>> David Johns wrote:
>>>>>>>>> I have a custom JDBC driver that I need to use while creating
>>>>>>>>> reports in the BIRT RCP Designer. I have run into two problems
>>>>>>>>> depending on the version of BIRT that I am running and I dont
>>>>>>>>> know how to resolve them. I would like to determine a way that
>>>>>>>>> would work for both Birt2.2.2 and Birt2.3.2 versions if
>>>>>>>>> possible. I am not having a problem when I go to run the
>>>>>>>>> reports in my application, as they are embedded in my
>>>>>>>>> application and it replaces the data source using a JNDI
>>>>>>>>> lookup, so my problem is only when previewing and viewing
>>>>>>>>> reports from the BIRT RCP Designer.
>>>>>>>>>
>>>>>>>>> JDBC Driver Requirements:
>>>>>>>>> Main jar: AjJDBC.jar
>>>>>>>>> Supporting jars: AjConnectors.jar, wlfullclient.jar, sqljdbc.jar
>>>>>>>>>
>>>>>>>>> All of these files need to be in the classpath when connecting
>>>>>>>>> and querying the data. The driver wraps the normal sql server
>>>>>>>>> jdbc driver and makes JEE calls to Weblogic when it intercepts
>>>>>>>>> certain data fields being returned in the result set. Also,
>>>>>>>>> part of this is using the Java Security Framework (JAAS) to log
>>>>>>>>> in to Weblogic.
>>>>>>>>>
>>>>>>>>> This works fine outside of BIRT when it has everything in its
>>>>>>>>> class path. However, I am getting class not found errors in
>>>>>>>>> BIRT during different circumstances when previewing a report.
>>>>>>>>>
>>>>>>>>> Problem Summaries:
>>>>>>>>> Problem 1: Cannot put all .jar files in ../drivers directory
>>>>>>>>> because it causes BIRT to hang when viewing the DataSource
>>>>>>>>> because of .jar size (wlfullclient.jar is 56MB).
>>>>>>>>>
>>>>>>>>> Problem 2: Even if all .jar files are in the ../drivers
>>>>>>>>> directory, in Birt 2.2.2 when previewing a report, the
>>>>>>>>> ContextClassLoader is a WebApp classloader and the login
>>>>>>>>> security has the wrong classloader, so it cannot find and load
>>>>>>>>> subject during the login.
>>>>>>>>>
>>>>>>>>> I can provide a lot more details of what I have tried if you
>>>>>>>>> are interested
>>>>>>>>>
>>>>>>>>> Requested solution:
>>>>>>>>> I am looking for a solution that would let me configure BIRT so
>>>>>>>>> that I would not have to modify my jdbc driver, but when Birt
>>>>>>>>> was accessing the ODA JDBC data source using my JDBC driver it
>>>>>>>>> will have the correct .jar files available to the correct class
>>>>>>>>> loader. If that is not possible, then I need to know what the
>>>>>>>>> appropriate changes would be to correctly let clients use the
>>>>>>>>> BIRT RCP Designer with our JDBC driver.
>>>>>>>>>
>>>>>>>>> Any help in this would be greatly appreciated.
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Previous Topic:BIRT osgi issue
Next Topic:SQL Query Builder
Goto Forum:
  


Current Time: Fri Mar 29 07:02:39 GMT 2024

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

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

Back to the top