Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Birt Viewer, DataSource, Password
Birt Viewer, DataSource, Password [message #511912] Wed, 03 February 2010 12:20 Go to next message
Ricky Ru is currently offline Ricky RuFriend
Messages: 14
Registered: February 2010
Junior Member
Hi friends,

I met a problem.
We developed some plugins into birt designer to enable user to create the rptdesign as they want. One of the feature is to use our own method to encrypt the password of data source. like this:
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source" id="6">
<text-property name="displayName"></text-property>
<property name="odaDriverClass">rkyoem.jdbc.oracle.OracleDriver</property >
<property name="odaURL">jdbc:rkyoem:oracle://xi-fru:1521;SID=ORCL</property>
<property name="odaUser">scott</property>
<encrypted-property name="odaPassword" encryptionID=" com.rky.reporting.birt.designer.repository.encode.CryptoHelp er ">[355386a03baa786762fa5da04a54618005]</encrypted-property>
</oda-data-source>
</data-sources>
Of course, I know how to decrypt the password.

First, I created the rptdocument via this:
........
runTask.getAppContext().put("Data Source" , conn);
runTask.run("d:\temp\my.rptdocument");
......

After that, I wanted to show the result in birt-viewer and issue request http://xi-fru.rky.com:8084/birt-viewer/frameset?__document=d :\temp\my.rptdocument. I have already put the driver and the decryption class into birt-viewer\WEB-INF\platform\plugins\org.eclipse.birt.report .data.oda.jdbc_2.3.1.v20080827\drivers

But I got the following error:
rg.eclipse.birt.data.engine.core.DataException: Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.
There is an error in get connection, [RKYOEM][Oracle JDBC Driver][Oracle]ORA-01017: invalid username/password; logon denied
.
at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.o penConnection(ConnectionManager.java:169)
at org.eclipse.birt.data.engine.executor.DataSource.newConnecti on(DataSource.java:210)
at org.eclipse.birt.data.engine.executor.DataSource.open(DataSo urce.java:197)
at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiD ataSource(DataSourceRuntime.java:209)
at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSour ce(QueryExecutor.java:386)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecu tion(QueryExecutor.java:305)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(Pr eparedQuery.java:498)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.pr oduceQueryResults(PreparedDataSourceQuery.java:189)

I know the issue was caused that the password was not decrypted when birt viewer tried to connect the database server again. Do you have any suggestion on where should I place the decryption class or what steps I should follow to fix this issue?

Thanks
Re: Birt Viewer, DataSource, Password [message #512010 is a reply to message #511912] Wed, 03 February 2010 11:32 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Ricky,

Did you implement the org.eclipse.birt.report.model.encryptionHelper
extension point? If you do you should be able to just place it in your
plugins folder.

Jason

Ricky Ru wrote:
> Hi friends,
>
> I met a problem. We developed some plugins into birt designer to enable
> user to create the rptdesign as they want. One of the feature is to use
> our own method to encrypt the password of data source. like this:
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
> id="6">
> <text-property name="displayName"></text-property>
> <property
> name="odaDriverClass">rkyoem.jdbc.oracle.OracleDriver</property >
> <property
> name="odaURL">jdbc:rkyoem:oracle://xi-fru:1521;SID=ORCL</property>
> <property name="odaUser">scott</property>
> <encrypted-property name="odaPassword" encryptionID="
> com.rky.reporting.birt.designer.repository.encode.CryptoHelp er
> ">[355386a03baa786762fa5da04a54618005]</encrypted-property>
> </oda-data-source>
> </data-sources>
> Of course, I know how to decrypt the password.
> First, I created the rptdocument via this:
> ........
> runTask.getAppContext().put("Data Source" , conn);
> runTask.run("d:\temp\my.rptdocument");
> .....
>
> After that, I wanted to show the result in birt-viewer and issue request
> http://xi-fru.rky.com:8084/birt-viewer/frameset?__document=d :\temp\my.rptdocument
> I have already put the driver and the decryption class into
> birt-viewer\WEB-INF\platform\plugins\org.eclipse.birt.report
> .data.oda.jdbc_2.3.1.v20080827\drivers
>
> But I got the following error:
> rg.eclipse.birt.data.engine.core.DataException: Cannot open the
> connection for the driver: org.eclipse.birt.report.data.oda.jdbc.
> There is an error in get connection, [RKYOEM][Oracle JDBC
> Driver][Oracle]ORA-01017: invalid username/password; logon denied
Re: Birt Viewer, DataSource, Password [message #512185 is a reply to message #512010] Thu, 04 February 2010 10:53 Go to previous messageGo to next message
Ricky Ru is currently offline Ricky RuFriend
Messages: 14
Registered: February 2010
Junior Member
Yes, I developed a plugin to implement the extension point as you said. And also, I could see it take effect when I placed it into the plugins folder of birt designer. The password was encrypted as I wanted. And I could preview the report result.

But , It did not take effect if I placed the plugin into the plugins folder of birt-viewer which was running in a web container. I also wrote a test class to run the same birt report through java code. I also put plugin into the plugins folder of Birt Engine. But I got the same error(can not connect database due to invalid username/password). I can make sure the start method of Activator was not executed. So, It seems my plugin was not loaded.


My plugin was very easy like this:
public class EncryptionHelper3 implements IEncryptionHelper {

public String decrypt(String string) {
// TODO Auto-generated method stub
if ("tiger1".equals(string))
{
return "tiger";
}
return string;
}
public String encrypt(String string) {
// TODO Auto-generated method stub
if ("tiger".equals(string))
{
return "tiger1";
}
return string;
}
}

The following is the data source node generated in the designer.
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source" id="6">
<property name="odaDriverClass">oracle.jdbc.driver.OracleDriver</property >
<property name="odaURL">jdbc:oracle:thin:@xi-fru:1521:ORCL</property >
<property name="odaUser">scott</property>
<encrypted-property name="odaPassword" encryptionID="rky_plugin.EncryptionHelper3">tiger1</encrypted-property >
</oda-data-source>
</data-sources>

Does anyone have suggestion on that? Any help will be very appreciated.
Re: Birt Viewer, DataSource, Password [message #512312 is a reply to message #512185] Thu, 04 February 2010 11:24 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Ricky,

I just tried with BIRT 2.5.1 and had no issues. Verify in your
manifest.mf file that you have no dependencies on any ui plugins.

Jason

Ricky Ru wrote:
> Yes, I developed a plugin to implement the extension point as you said.
> And also, I could see it take effect when I placed it into the plugins
> folder of birt designer. The password was encrypted as I wanted. And I
> could preview the report result.
>
> But , It did not take effect if I placed the plugin into the plugins
> folder of birt-viewer which was running in a web container. I also wrote
> a test class to run the same birt report through java code. I also put
> plugin into the plugins folder of Birt Engine. But I got the same
> error(can not connect database due to invalid username/password). I can
> make sure the start method of Activator was not executed. So, It seems
> my plugin was not loaded.
>
>
> My plugin was very easy like this:
> public class EncryptionHelper3 implements IEncryptionHelper {
>
> public String decrypt(String string) {
> // TODO Auto-generated method stub
> if ("tiger1".equals(string))
> {
> return "tiger";
> }
> return string;
> }
> public String encrypt(String string) {
> // TODO Auto-generated method stub
> if ("tiger".equals(string))
> {
> return "tiger1";
> }
> return string;
> }
> }
>
> The following is the data source node generated in the designer.
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
> id="6">
> <property
> name="odaDriverClass">oracle.jdbc.driver.OracleDriver</property >
> <property
> name="odaURL">jdbc:oracle:thin:@xi-fru:1521:ORCL</property >
> <property name="odaUser">scott</property>
> <encrypted-property name="odaPassword"
> encryptionID="rky_plugin.EncryptionHelper3">tiger1</encrypted-property >
> </oda-data-source>
> </data-sources>
>
> Does anyone have suggestion on that? Any help will be very appreciated.
Re: Birt Viewer, DataSource, Password [message #513139 is a reply to message #512312] Tue, 09 February 2010 02:44 Go to previous message
Ricky Ru is currently offline Ricky RuFriend
Messages: 14
Registered: February 2010
Junior Member
Hi Jason,

You are right. It worked. Thanks for your help! Smile
Previous Topic:Problem : localizing message with parameters
Next Topic:[SLOVED]How to dynamic add data to dataset by java? (without script)
Goto Forum:
  


Current Time: Thu Apr 25 05:53:57 GMT 2024

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

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

Back to the top