|
Re: Eclipse Preview Viewer JNDI Question [message #534637 is a reply to message #534518] |
Wed, 19 May 2010 17:14 |
|
Marty,
If you have a JNDI setting in deployment it should be trying this before
it attempts to normal connection. It should only be using normal if
JNDI fails. BTW I like the idea of adding support to the jetty server
for this feature. Any chance you could open a bug for this?
Jason
On 5/19/2010 8:12 AM, Marty Jones wrote:
> Is there a way to setup the embedded Jetty server that the Eclipse
> Report Preview viewer uses to use the jndi lookup instead of the normal
> connection parameters?
>
> The problem I am having is that I have to specify the normal connection
> parameters to create and modify reports while in eclipse but then
> remember to remove those settings so that the jndi settings will be used
> by the web server once the report is deployed.
>
> It would be nice if I could just specify the jndi settings and have the
> eclipse preview viewer use the jndi settings to make the db connection.
>
> Any Help Would Be Appreciated,
>
> Marty Jones
|
|
|
|
|
Re: Eclipse Preview Viewer JNDI Question [message #534684 is a reply to message #534650] |
Wed, 19 May 2010 21:17 |
|
Marty,
You may want to look at connection profiles. You can also put some
script in to determine if you are in the designer (Let me know if you
need an example). It would be good if you could log a bug on the
connection as well, because if you have a JNDI connection it should not
be using the user and password I believe.
I looked a little at the jetty connection pool to see if we could just
add it to the WebViewer. It seems as that may be possible with just a
couple config files. I will let you know what I find.
Jason
On 5/19/2010 2:06 PM, Marty Jones wrote:
> Jason,
>
> I opened a bug ticket.
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=313591
>
> Let me know if there is anything else I can do.
|
|
|
|
|
Re: Eclipse Preview Viewer JNDI Question [message #534873 is a reply to message #534799] |
Thu, 20 May 2010 14:12 |
|
Marty,
Remove the datasource and create a new one from the connection profile
and see if that works.
On the Jetty piece can you try to add a jetty-env.xml file to the
webviewer/birt/WEB-INF directory like:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<New id="MyDataSource" class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/MyDataSource</Arg>
<Arg>
<New
class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource ">
<Set name="Url">jdbc:mysql://localhost:3306/myDatabase</Set>
<Set name="User">myUsername</Set>
<Set name="Password">myPassword</Set>
</New>
</Arg>
</New>
</Configure>
Then add this to the web.xml
<resource-ref>
<description>This is the true source of enlightenment.</description>
<res-ref-name>jdbc/MyDataSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Also put your db driver in the web-inf/lib dir. Not certain this will
work but worth a try.
Jason
On 5/20/2010 7:35 AM, Marty Jones wrote:
> Jason,
>
> I took a look at connection profiles and I am confused. I externalized a
> datasource as a connection profile and then created a new datasource
> using the connection profile but the report design file has both the
> connection profile file path as well as the jdbc connection settings! I
> would think it would only contain the connection profile path
> information and that would be it.
> I wonder if this is because of the version of BIRT I am running. I am
> running version 2.3.2 (in RAD 7.5.4 for WebSphere).
> I am of the opinion that if we could get jndi working on the embedded
> Jetty server then it would be an easier solution. That way I am not
> storing username and password information anywhere except my development
> machine and our web server's jndi setup. I don't like having username
> and password information stored in multiple places if it can be avoided.
>
> Marty
|
|
|
|
|
Re: Eclipse Preview Viewer JNDI Question [message #534906 is a reply to message #534897] |
Thu, 20 May 2010 15:36 |
|
Marty,
In 2.5.2 it does not store them. The jetty JNDI feature may be more
difficult than I first imagined. One other option to try is to use
property binding on a normal datasource. You can check whether you are
in the designer or not like:
//property binding on user and password
if(reportContext.getHttpServletRequest().getAttribute("attributeBean ").isDesigner()){
"mydesigneruser";
}else{
"";
}
Jason
On 5/20/2010 11:09 AM, Marty Jones wrote:
> Jason,
>
> I verified that I am updating the correct location within the plugin
> folder. Unfortunately I am getting a connection error when I do a preview.
>
> I think there may be a bigger problem though. The Report Designer uses
> the datasource to generate the dataset information such as "Output
> Columns" and other information related to the query. I don't think that
> modifying the Jetty server is going to fix this part.
>
> I guess I am back to looking at the connection profiles.
>
> Here are the steps I did with the connection profile:
>
> (I downloaded the RCP standalone Designer version 2.5.2)
>
> 1. create new report.
> 2. create new datasource.
> - chose to create from a connection profile in the profile store.
> - picked path to the profile store.
>
> Here is the report's xml configuration:
>
> <data-sources>
> <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc"
> name="New BIRT JDBC Data Source" id="7">
> <text-property name="displayName"></text-property>
> <list-property name="privateDriverProperties">
> <ex-property>
> <name>contentBidiFormatStr</name>
> <value>ILYNN</value>
> </ex-property>
> <ex-property>
> <name>metadataBidiFormatStr</name>
> <value>ILYNN</value>
> </ex-property>
> </list-property>
> <property name="odaDriverClass">org.postgresql.Driver</property>
> <property name="odaURL">jdbc:postgresql:mydb</property>
> <property name="odaUser">user</property>
> <encrypted-property name="odaPassword"
> encryptionID="base64">emFwbG9g</encrypted-property>
> <property name="OdaConnProfileName">New BIRT JDBC Data Source</property>
> <property
> name="OdaConnProfileStorePath">C:\temp\test_conn_profile</property >
> </oda-data-source>
> </data-sources>
>
>
>
> as you can see it put both the profile location and the jdbc information
> in. I assume that this should not be the case??
>
|
|
|
Re: Eclipse Preview Viewer JNDI Question [message #534941 is a reply to message #534906] |
Thu, 20 May 2010 18:06 |
Marty Jones Messages: 54 Registered: July 2009 |
Member |
|
|
Jason,
I tried using the expression you gave me in the property bindings section and in the beforeOpen event script section and I am getting the following error when I try to preview the report:
Note: I am using the expression to set the username, password, url, and driver. Basically if I am in designer then I want to set all of these values. If I am not then I only want the normal jndi setting to be used.
Also, I am making these settings in a Report Library that is shared by multiple reports.
Error evaluating Javascript expression. Script engine error: TypeError: Cannot call method "isDesigner" of null
Script source: <inline>, line: 0, text:
//property binding on user and password
if(reportContext.getHttpServletRequest().getAttribute("attributeBean ").isDesigner()){
"jdbc:oracle:thin:@mydb:1521:go";
}else{
"";
}
birt.core.JavascriptError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: Error evaluating Javascript expression. Script engine error: TypeError: Cannot call method "isDesigner" of null Script source: <inline>, line: 0, text://property binding on user and passwordif(reportContext.getHttpServletRequest().getAttribute("attributeBean ").isDesigner()){ "jdbc:oracle:thin:@mydb:1521:go";}else{ "";} at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(Unknown Source) at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.prepare(Unknown Source) at org.eclipse.birt.report.engine.executor.ReportExecutor.execute(Unknown Source) at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.execute(Unknown Source) at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplciateReportExecutor.execute(Unknown Source) at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.execute(Unknown Source) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(Unknown Source) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(Unknown Source) at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(Unknown Source) at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(Unknown Source) at org.eclipse.birt.report.service.actionhandler.BirtGetPageAllActionHandler.__execute(Unknown Source) at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(Unknown Source) at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(Unknown Source) at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(Unknown Source) at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPageAll(Unknown Source) at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(Unknown Source) at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(Unknown Source) at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.axis.providers.java.RPCProvider.invokeMethod(Unknown Source) at org.apache.axis.providers.java.RPCProvider.processMessage(Unknown Source) at org.apache.axis.providers.java.JavaProvider.invoke(Unknown Source) at org.apache.axis.strategies.InvocationStrategy.visit(Unknown Source) at org.apache.axis.SimpleChain.doVisiting(Unknown Source) at org.apache.axis.SimpleChain.invoke(Unknown Source) at org.apache.axis.handlers.soap.SOAPService.invoke(Unknown Source) at org.apache.axis.server.AxisServer.invoke(Unknown Source) at org.apache.axis.transport.http.AxisServlet.doPost(Unknown Source) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(Unknown Source) at org.apache.axis.transport.http.AxisServletBase.service(Unknown Source) at javax.servlet.http.HttpServlet.service(Unknown Source) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(Unknown Source) at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(Unknown Source) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(Unknown Source) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(Unknown Source) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(Unknown Source) at javax.servlet.http.HttpServlet.service(Unknown Source) at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(Unknown Source) at org.mortbay.jetty.servlet.ServletHolder.handle(Unknown Source) at org.mortbay.jetty.servlet.ServletHandler.dispatch(Unknown Source) at org.mortbay.jetty.servlet.ServletHandler.handle(Unknown Source) at org.mortbay.http.HttpContext.handle(Unknown Source) at org.mortbay.http.HttpContext.handle(Unknown Source) at org.mortbay.http.HttpServer.service(Unknown Source) at org.mortbay.http.HttpConnection.service(Unknown Source) at org.mortbay.http.HttpConnection.handleNext(Unknown Source) at org.mortbay.http.HttpConnection.handle(Unknown Source) at org.mortbay.http.SocketListener.handleConnection(Unknown Source) at org.mortbay.util.ThreadedServer.handle(Unknown Source) at org.mortbay.util.ThreadPool$PoolThread.run(Unknown Source)
[Updated on: Thu, 20 May 2010 18:37] Report message to a moderator
|
|
|
Re: Eclipse Preview Viewer JNDI Question [message #534978 is a reply to message #534941] |
Thu, 20 May 2010 20:30 |
|
Marty,
What version of BIRT are you using?
also change the syntax to
var attbean =
reportContext.getHttpServletRequest().getAttribute("attributeBean ");
if( attbean == null || attbean.isDesigner() ){
..
..
..
Jason
On 5/20/2010 2:06 PM, Marty Jones wrote:
> Jason,
>
> I tried using the expression you gave me in the property bindings
> section and I am getting the following error when I try to preview the
> report:
>
> Note: I am using the expression to set the username, password, url, and
> driver. Basically if I am in designer then I want to set all of these
> values. If I am not then I only want the normal jndi setting to be used.
>
>
> Error evaluating Javascript expression. Script engine error: TypeError:
> Cannot call method "isDesigner" of null
> Script source: <inline>, line: 0, text:
> //property binding on user and password
> if(reportContext.getHttpServletRequest().getAttribute("attributeBean
> ").isDesigner()){
> "jdbc:oracle:thin:@mydb:1521:go";
> }else{
> "";
> } birt.core.JavascriptError ( 1 time(s) )
> detail : org.eclipse.birt.report.engine.api.EngineException: Error
> evaluating Javascript expression. Script engine error: TypeError: Cannot
> call method "isDesigner" of null Script source: <inline>, line: 0,
> text://property binding on user and
> passwordif(reportContext.getHttpServletRequest().getAttribut e( "attributeBean
> ").isDesigner()){ "jdbc:oracle:thin:@mydb:1521:go";}else{ "";} at
> org.eclipse.birt.report.engine.executor.ExecutionContext.add Exception(Unknown
> Source) at
> org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.p repare(Unknown
> Source) at
> org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(Unknown
> Source) at
> org.eclipse.birt.report.engine.internal.executor.wrap.Wrappe dReportExecutor.execute(Unknown
> Source) at
> org.eclipse.birt.report.engine.internal.executor.dup.Suppres sDuplciateReportExecutor.execute(Unknown
> Source) at
> org.eclipse.birt.report.engine.internal.executor.wrap.Wrappe dReportExecutor.execute(Unknown
> Source) at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(Unknown
> Source) at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (Unknown
> Source) at
> org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
> Source) at
> org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(Unknown
> Source) at
> org.eclipse.birt.report.service.actionhandler.BirtGetPageAll ActionHandler.__execute(Unknown
> Source) at
> org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(Unknown
> Source) at
> org.eclipse.birt.report.soapengine.processor.AbstractBaseDoc umentProcessor.__executeAction(Unknown
> Source) at
> org.eclipse.birt.report.soapengine.processor.AbstractBaseCom ponentProcessor.executeAction(Unknown
> Source) at
> org.eclipse.birt.report.soapengine.processor.BirtDocumentPro cessor.handleGetPageAll(Unknown
> Source) at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
> java.lang.reflect.Method.invoke(Unknown Source) at
> org.eclipse.birt.report.soapengine.processor.AbstractBaseCom ponentProcessor.process(Unknown
> Source) at
> org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingI mpl.getUpdatedObjects(Unknown
> Source) at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
> java.lang.reflect.Method.invoke(Unknown Source) at
> org.apache.axis.providers.java.RPCProvider.invokeMethod(Unkn own Source)
> at org.apache.axis.providers.java.RPCProvider.processMessage(Un known
> Source) at org.apache.axis.providers.java.JavaProvider.invoke(Unknown
> Source) at org.apache.axis.strategies.InvocationStrategy.visit(Unknown
> Source) at org.apache.axis.SimpleChain.doVisiting(Unknown Source) at
> org.apache.axis.SimpleChain.invoke(Unknown Source) at
> org.apache.axis.handlers.soap.SOAPService.invoke(Unknown Source) at
> org.apache.axis.server.AxisServer.invoke(Unknown Source) at
> org.apache.axis.transport.http.AxisServlet.doPost(Unknown Source) at
> org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer vlet.doPost(Unknown
> Source) at javax.servlet.http.HttpServlet.service(Unknown Source) at
> org.apache.axis.transport.http.AxisServletBase.service(Unkno wn Source)
> at javax.servlet.http.HttpServlet.service(Unknown Source) at
> org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherSer vlet.service(Unknown
> Source) at
> org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(Unknown
> Source) at
> org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.handleRequest(Unknown
> Source) at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(Unknown
> Source) at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(Unknown
> Source) at javax.servlet.http.HttpServlet.service(Unknown Source) at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager$In ternalHttpServiceServlet.service(Unknown
> Source) at org.mortbay.jetty.servlet.ServletHolder.handle(Unknown
> Source) at org.mortbay.jetty.servlet.ServletHandler.dispatch(Unknown
> Source) at org.mortbay.jetty.servlet.ServletHandler.handle(Unknown
> Source) at org.mortbay.http.HttpContext.handle(Unknown Source) at
> org.mortbay.http.HttpContext.handle(Unknown Source) at
> org.mortbay.http.HttpServer.service(Unknown Source) at
> org.mortbay.http.HttpConnection.service(Unknown Source) at
> org.mortbay.http.HttpConnection.handleNext(Unknown Source) at
> org.mortbay.http.HttpConnection.handle(Unknown Source) at
> org.mortbay.http.SocketListener.handleConnection(Unknown Source) at
> org.mortbay.util.ThreadedServer.handle(Unknown Source) at
> org.mortbay.util.ThreadPool$PoolThread.run(Unknown Source)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04446 seconds