Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile(cannot connect to database from tomcat)
annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #544150] Thu, 01 July 2010 18:38 Go to next message
jl  is currently offline jl Friend
Messages: 3
Registered: July 2010
Junior Member
Hello everyone, i am stuck Smile

what are the actual steps to make birt-viewer talk to mysql via jdbc in linux?

i just created a simple report in Eclipse Galileo

Tomcat 5.5, mysql and birt viewer are all working fine. I am running ubuntu.

Reports that have no database connectivity work. those with, fail to execute.

I have downloaded mysql connector j, i copied the jar file into:

birt-viewer/WEB-INF/platform/plugins/org.eclipse.report.birt .oda.jdbc_2_6_0.v20100524/drivers

i found an oda*jar file already in:

birt-viewer/WEB-INF/platform/plugins/org.eclipse.report.birt .oda.jdbc_2_6_0.v20100524 i left it there

i have tried with 2 versions of mysql connector (508 and the latest)

ideas, suggestions?

Thanks!

jl
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #544161 is a reply to message #544150] Thu, 01 July 2010 20:21 Go to previous messageGo to next message
Byron Palmer is currently offline Byron PalmerFriend
Messages: 14
Registered: July 2009
Junior Member
My guess from my experience is that you used the new Query Builder connection. If that is true and you deployed the report and got the error you mentioned, it is because the 2.6 runtime does not have one file that you need.

So if this is true, go into your eclipse plugins, find the following file, and copy it to the plugins directory of tomcat.

org.eclipse.datatools.modelbase.sql.query_*.jar bundle jar

That should clear up your problem.
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #544193 is a reply to message #544161] Thu, 01 July 2010 23:44 Go to previous messageGo to next message
jl  is currently offline jl Friend
Messages: 3
Registered: July 2010
Junior Member
thanks, unfortunately the problem persists after copying the files from galileo to birt-viewer (tomcat)

i put all org.eclipse.datatools.modelbase.sql* into the plugins directory of birt-viewer. the 2 jar files (connect and oda) are in the *jdbc*/drivers directory

i also tried with no success:

- putting the 2 jar files in the tomcat/shared/lib
-also in birt-viewer/WEB-INF/lib

what else is needed?

there must be a way to duplicate installations of birt-tomcat.

also, if i do not use galileo, what is needed?

thanks again!
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #544196 is a reply to message #544193] Thu, 01 July 2010 23:53 Go to previous messageGo to next message
Byron Palmer is currently offline Byron PalmerFriend
Messages: 14
Registered: July 2009
Junior Member
I am confused. If you are using BIRT 2.6 as indicated by the file you referenced. But you are copying from Galileo which may or may not be at 2.6. Could you verify that your BIRT plugins that you are copying from Galieo are at 2.6. If not, then you will need to download the Helios version of the BIRT all in one and get the file from there.
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #544294 is a reply to message #544196] Fri, 02 July 2010 09:04 Go to previous messageGo to next message
jl  is currently offline jl Friend
Messages: 3
Registered: July 2010
Junior Member
thanks for the suggestions!

I am more confused Smile

Also, my birt-viewer (runtime) version is 2.6, java jre 1.6, tomcat 5.5

it is locatedin $tomcatdir/webapps

birt-viewer works.

what are the connectivity files i need to copy to birt-viewer jar and any other file?

i have read about itext but that is for pdf generation. i am not using it. in fact my report is empty, just a label.

what i did:

i copied mysqlconnector jar (i tried 2 versions, 5.1.13 and 5.0.Cool
to the plugins/*jdbc*/drivers dir

i reinstalled birt-all-in-one 2.6 on the designer machine. reports and connectivity are fine.

lets say i start from zero (and mysql and tomcat are working) on the server side (tomcat-birt-viewer)

what are the actual steps?

designer:
-download and install birt-allinone in my windoze pc
-in birt eclipse ide,configure the jdbc driver after downloading the mconnect/j
-make report, connect to db, run

server:
-extract birt-viewer (directory) from birt 2.6 runtime
-dump it in tomcatdir/webapps
-restart tomcat
-test birt viewer.

here is where it gets tricky with jdbc

-my-sqlconnector jdbc driver jar file goes to the plugins/drivers

-the rest of maybe missing files org.eclipse.datatools.modelbase.sql.query_*.jar bundle jar go to the plugins directory

i copied
org.eclipse.datatools.modelbase.sql_1.0.4.v201002250945
org.eclipse.datatools.modelbase.sql.xml.query_1.0.1.v2010042 91415
org.eclipse.datatools.modelbase.sql.query_1.1.0.v20100520204 5
org.eclipse.datatools.modelbase.sql.query.edit_1.0.0.v200906 022249
org.eclipse.datatools.modelbase.sql.edit_1.0.1.v201002161452

-chmod 755 to the jar files

did not work

i even copied all the missing files from plugins in birt-all-in-one (pc) to the birt-viewer plugins directory.

it keeps complaining about the same thing:

Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile. org.eclipse.datatools.connectivity.oda.OdaException ; java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

what am i missing? permissions?

i am sure there is someone else in the world who has installed birt 2.6 in tomcat 5.5 and mysql 5.1 under linux (ubuntu) and has the STEP BY STEP process to duplicate a successful installation over and over.

thanks amigos!
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #544503 is a reply to message #544294] Sat, 03 July 2010 01:10 Go to previous messageGo to next message
Linda ChanFriend
Messages: 845
Registered: July 2009
Senior Member
>> Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile. org.eclipse.datatools.connectivity.oda.OdaException ; java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

This message indicates that the path of the mysql JDBC driver jar specified in the jarList property (of your data source design) is not found or cannot be loaded.
Perhaps the path needs to be updated to the one applicable in your Linux deployment environment.
You can use Property Binding or externalized connection profile to adjust the value of the jarList property, based on your deployment environment.

Linda
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #545142 is a reply to message #544503] Tue, 06 July 2010 18:15 Go to previous messageGo to next message
Adrien Guichard is currently offline Adrien GuichardFriend
Messages: 1
Registered: July 2010
Junior Member
I do have the exact same problem on Mandriva 2010.1, using postgresql, with birt-runtime-2_6_0 and birt-runtime-2_6_1-N20100706.

I am using Tomcat 5.5 and properly copied jdbc driver in .../*jdbc*/drivers. The test report is working.
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #545161 is a reply to message #545142] Tue, 06 July 2010 20:07 Go to previous messageGo to next message
Linda ChanFriend
Messages: 845
Registered: July 2009
Senior Member


If you are using the oda.jdbc.dbprofile data source type and SQB, it is based on the DTP db connection profile framework, which does not use the .../*jdbc*/drivers folder. Instead, it looks for the JDBC driver from the path specified in the jarList data source property.

Linda
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #636199 is a reply to message #545161] Fri, 29 October 2010 15:43 Go to previous messageGo to next message
Bluish Joe is currently offline Bluish JoeFriend
Messages: 13
Registered: October 2010
Junior Member
Linda (or anyone else),
you said "it looks for the JDBC driver from the path specified in the jarList data source property".
Yes I know this property. The problem is: how can I specify a relative path? It seems you can only indicate an absolute path. This reduces the portability of the report.
Thanku!
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #636214 is a reply to message #636199] Fri, 29 October 2010 16:18 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Have you tried using property binding to change the jarList property at
runtime? Or a beforeOpen script similar to this:

if(
!reportContext.getHttpServletRequest().getAttribute("attributeBean ").isDesigner()
){
rp =
reportContext.getHttpServletRequest().getSession().getServle tContext().getRealPath( "/myapp");
rp = rp + "/myjar.jar";
this.setExtensionProperty("jarList",rp);
}

Jason

On 10/29/2010 11:43 AM, bluish wrote:
> Linda (or anyone else),
> you said "it looks for the JDBC driver from the path specified in the
> jarList data source property". Yes I know this property. The problem is:
> how can I specify a relative path? It seems you can only indicate an
> absolute path. This reduces the portability of the report.
> Thanku!
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #636240 is a reply to message #636214] Fri, 29 October 2010 19:51 Go to previous messageGo to next message
Linda ChanFriend
Messages: 845
Registered: July 2009
Senior Member
Like what Jason described, there are multiple ways to adjust the property values for different deployment environments.

Here is a prior post re: how to use a variable to adjust a property value in Property Binding.

http://www.eclipse.org/forums/index.php?t=msg&goto=36893 9&

Another way is to externalize a data source's property values to a connection profile store file.
In the BIRT designer's Data Explorer, bring up the context menu of a selected data source design, and select the "Export to Connection Profile..." menu option.
And then when you deploy the report design and associated profile store file to another environment, just edit the property values in the copy of the profile store file.
You would probably still want to use Property Binding to specify a relative path for the connection profile store file location. With this approach, you can adjust any connection property, not just the jarList.

Linda

Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #636610 is a reply to message #636240] Tue, 02 November 2010 08:11 Go to previous messageGo to next message
Bluish Joe is currently offline Bluish JoeFriend
Messages: 13
Registered: October 2010
Junior Member
Thank you to everyone, it's all very usefull! I'll try it as soon as I'll be free.
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #639716 is a reply to message #636240] Wed, 17 November 2010 15:15 Go to previous messageGo to next message
Bluish Joe is currently offline Bluish JoeFriend
Messages: 13
Registered: October 2010
Junior Member
Hello, I'm back!
I tried the solutions proposed by Linda in the page
http://www.eclipse.org/forums/index.php?t=msg&goto=36893 9& .
Expecially I think this one fits best in my case:
Quote:
1) The JavaScript expression can refer to any BIRT config[] variable. For example,
config[ "birt.viewer.working.path" ] + "../../data/myProfiles.dat"


So in "Edit Data Source", in "Property Binding", as "JDBC Driver JAR List" I put
config[ "birt.viewer.working.path" ] + "jt400.jar"
.
Debugging config["birt.viewer.working.path"], I saw that, working in the Eclipse designer, its " C:\Users\xxx\workspace-eclipse\.metadata\.plugins\org.eclips e.birt.report.viewer ". I put my jt400.jar there.

Unfortunately I had to specify a JAR List path for my driver. So In the same window, in "JDBC Driver and Connection Details" I clicked in the triangle button; in the new window in the "JAR List" tab I added the entry "C:/temp/jt400.jar". I placed another copy of my jar in that folder, hoping not to use it.

I saved. Ran preview and worked, ran the report in birt-viewer and worked. But if I remove jt400.jar from "C:/temp" it doesn't work. It seems it doesn't care of our
config[ "birt.viewer.working.path" ] + "jt400.jar"
I tried adding a slash/backslash before "jt400.jar" or putting it in a nested folder... nothing.

I hope you can help me. Thanks!
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #639773 is a reply to message #639716] Wed, 17 November 2010 17:42 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

In the expression for the property binding could you add something like:

importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/checkpath.txt", true ) );
out.println( config[ "birt.viewer.working.path" ] + "jt400.jar");
out.close();
add this to the top of the expression. Expressions always return the
last line. You may also want to try setting the value in the beforeOpen
script of the datasource.

var rp = config[ "birt.viewer.working.path" ]+ "/jt400.jar";
this.setExtensionProperty("jarList",rp);

Jason

On 11/17/2010 10:15 AM, bluish wrote:
> Hello, I'm back!
> I tried the solutions proposed by Linda in the page
> http://www.eclipse.org/forums/index.php?t=msg&goto=36893 9& .
> Expecially I think this one fits best in my case:
> Quote:
>> 1) The JavaScript expression can refer to any BIRT config[] variable.
>> For example, config[ "birt.viewer.working.path" ] +
>> "../../data/myProfiles.dat"
>
>
> So in "Edit Data Source", in "Property Binding", as "JDBC Driver JAR
> List" I put config[ "birt.viewer.working.path" ] + "jt400.jar".
> Debugging config["birt.viewer.working.path"], I saw that, working in the
> Eclipse designer, its "
> C:\Users\xxx\workspace-eclipse\.metadata\.plugins\org.eclips
> e.birt.report.viewer ". I put my jt400.jar there.
>
> Unfortunately I had to specify a JAR List path for my driver. So In the
> same window, in "JDBC Driver and Connection Details" I clicked in the
> triangle button; in the new window in the "JAR List" tab I added the
> entry "C:/temp/jt400.jar". I placed another copy of my jar in that
> folder, hoping not to use it.
>
> I saved. Ran preview and worked, ran the report in birt-viewer and
> worked. But if I remove jt400.jar from "C:/temp" it doesn't work. It
> seems it doesn't care of our config[ "birt.viewer.working.path" ] +
> "jt400.jar" I tried adding a slash/backslash before "jt400.jar" or
> putting it in a nested folder... nothing.
>
> I hope you can help me. Thanks!
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #639862 is a reply to message #639773] Thu, 18 November 2010 08:03 Go to previous messageGo to next message
Bluish Joe is currently offline Bluish JoeFriend
Messages: 13
Registered: October 2010
Junior Member
This one, in the property binding, works:
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/checkpath.txt", true ) );
out.println( config[ "birt.viewer.working.path" ] + "jt400.jar");
out.close();

This one too:
var rp = config[ "birt.viewer.working.path" ]+ "/jt400.jar";
this.setExtensionProperty("jarList",rp);

But are instruction without any real effect. It seems that BIRT doesn't care of the JarList property, because the erro is always the same:
Table (id = 285): 
+ An exception occurred during processing. Please see the following message for details:
Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile.
    org.eclipse.datatools.connectivity.oda.OdaException ;
    java.lang.ClassNotFoundException: com.ibm.as400.access.AS400JDBCDriver 

That is it doesn't find C:/temp/jt400.jar.

I attach a screenshot, if it succeds..
http://localhost:8080/screenBIRT.png
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #639892 is a reply to message #639862] Thu, 18 November 2010 10:00 Go to previous messageGo to next message
Bluish Joe is currently offline Bluish JoeFriend
Messages: 13
Registered: October 2010
Junior Member
I'm happy to tell you I found the solution!

My way of creating a data source was using "JDBC Database Connection for Query Builder". In this way I must specify a location for the jar containing the driver.

Instead if I use the way "JDBC Data Source" I only have to indicate the driver class, that is "com.ibm.as400.access.AS400JDBCDriver" in my case.

The other step (maybe it comes first) is putting jt400.jar in
C:\Program Files (x86)\eclipse-reporting-helios-SR1-win32-x86_64\eclipse\plugins\org.eclipse.birt.report.data.oda.jdbc_2.6.1.v20100909\drivers
for the Eclipse birt-viewer plugin

and into
C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\birt-viewer\WEB-INF\lib
for the birt-viewer web application.

These 2 environments search in these places for DB drivers, this is what seems to happen.

I'm so happy I found the solution. I hope this could help someone else. Thanks to everyone!
Re: annot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.dbprofile [message #639975 is a reply to message #639892] Thu, 18 November 2010 15:02 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Thanks for posting the solution.

Jason

On 11/18/2010 5:00 AM, bluish wrote:
> I'm happy to tell you I found the solution!
>
> My way of creating a data source was using "JDBC Database Connection for
> Query Builder". In this way I must specify a location for the jar
> containing the driver.
>
> Instead if I use the way "JDBC Data Source" I only have to indicate the
> driver class, that is "com.ibm.as400.access.AS400JDBCDriver" in my case.
>
> The other step (maybe it comes first) is putting jt400.jar in
> C:\Program Files
> (x86)\eclipse-reporting-helios-SR1-win32-x86_64\eclipse\plug ins\org.eclipse.birt.report.data.oda.jdbc_2.6.1.v20100909\dr iversfor
> the Eclipse birt-viewer plugin
>
> and into
> C:\Program Files\Apache Software Foundation\Tomcat
> 7.0\webapps\birt-viewer\WEB-INF\libfor the birt-viewer web application.
>
> These 2 environments search in these places for DB drivers, this is what
> seems to happen.
>
> I'm so happy I found the solution. I hope this could help someone else.
> Thanks to everyone!
Previous Topic:Failing when deployed (Websphere)
Next Topic:how run the reports in a shared server?
Goto Forum:
  


Current Time: Wed Apr 24 13:56:08 GMT 2024

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

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

Back to the top