Jump to content
Changes to the Jaspersoft community edition download ×

Writing a dataadapter plugin won't work


rudolfweber2

Recommended Posts

Hi,

I currently working on an project, implementing a dataadpter to connect to our server, fetching data and displaying them inside jasperstudio. The implementation looks pretty much the same as the com.jaspersoft.studio.data.hive plugin. The only difference I see, is that the DataAdapterImpl.xml is inside my plugin.

After debugging i found out, that the following line could not found the DataAdapterImpl.xml inside my plugin.

mis = JRLoader.getLocationInputStream(mappingFile);

Because it could not be found it throws the following exception

Caused by: net.sf.jasperreports.engine.JRRuntimeException: org.exolab.castor.mapping.MappingException: Nested error: org.exolab.castor.xml.MarshalException
at net.sf.jasperreports.util.CastorUtil.write(CastorUtil.java:378)
at net.sf.jasperreports.util.CastorUtil.write(CastorUtil.java:336)
at net.sf.jasperreports.util.CastorUtil.write(CastorUtil.java:516)
at com.jaspersoft.studio.data.DataAdapterDescriptor.toXml(DataAdapterDescriptor.java:90)
at com.jaspersoft.studio.data.DataAdapterManager.cloneDataAdapter(DataAdapterManager.java:185)
at com.jaspersoft.studio.data.wizard.DataAdapterWizard.createPageControls(DataAdapterWizard.java:75)
at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:736)
 
Is this a classpath problem? Maybe i have to use an extensionpoint somehow?
 
Thanks for the help
Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

I am working on the same, but did not have a DataAdapterImpl.xml in my jar, so thank you for the tip. I have not re-tested yet.

I wonder if it could be your 
PLUGIN_ID in your Activator class. This should be your code package name. I had quite a bit of troubles getting the icon to show on my New Data Adapter Dialog, it was the plugin id, as it is used to find the root path to icons. Perhaps the same with the DataAdapterImpl.xml.
 

Link to comment
Share on other sites

Make sure that your jasperreports_extension.properties has a line like:

net.sf.jasperreports.extension.repository.castor.mapping.mongodb=com/jaspersoft/mongodb/adapter/MongoDbDataAdapterImpl.xml

Seems it must get the path from that file.

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

im fightend the Same Issue at the Moment.

 

I wonder if you succeeded.  From my debugging it looks like the Hbase pluging gets the file IS via classloading (context loader). 

 

I'm still testing why my plugin doesn't succeed. File name and path looking good, but the ContextClassloader doesn't see the file. My eclipse Plattform coding is a bit rusty so I don't remember the exact architecture of the Classloader Architecture, something I need to do some relase arch on I think

 

 

stefan

Link to comment
Share on other sites

Hi All,

 

in case this still matters. I found the tricky Bit :-)

 

To enable classloading to see the mappin.xml ressource what you'd need to do is to add a Buddy registration to your plugin/Manifest file

 

 

Eclipse-BuddyPolicy: registered

Eclipse-RegisterBuddy: com.jaspersoft.studio.data

This one did the trick for me :-)

Stefan

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...