thevoice Posted May 21, 2008 Share Posted May 21, 2008 Hello there,i have ruby application in which i have to generate report from jasperserver Following is my java code which puts jrxml on server:public static void putJRXMLOnServer(JServer srv,String resourceName) throws Exception { ResourceDescriptor rdis = new ResourceDescriptor(); rdis.setResourceType(ResourceDescriptor.TYPE_JRXML); rdis.setName(resourceName); rdis.setLabel("TestJRXMLLabel"); rdis.setDescription("Test JRXML Description"); rdis.setParentFolder("/reportResources"); rdis.setUriString(rdis.getParentFolder() + "/" + rdis.getName()); rdis.setWsType(ResourceDescriptor.TYPE_JRXML); File jrxml = new File("/sites/launchcomm/app/reports/Report.jrxml"); rdis.setHasData(true); rdis.setIsNew(false); // rdis.setIsNew(true); srv.getWSClient().addOrModifyResource(rdis, jrxml); } When i run my java program ruby on rails application then i get the following error: java.lang.Exception: 2 - The resource was not found at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.modifyReportUnitResource(WSClient.java:500) at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.addOrModifyResource(WSClient.java:440) at MyDynamicReport.putJRXMLOnServer(MyDynamicReport.java:226) at MyDynamicReport.main(MyDynamicReport.java:73)Exception in thread "main" java.lang.Exception: 2 - The resource was not found at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.modifyReportUnitResource(WSClient.java:500) at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.addOrModifyResource(WSClient.java:440) at MyDynamicReport.putJRXMLOnServer(MyDynamicReport.java:226) at MyDynamicReport.main(MyDynamicReport.java:73) WHAT IS REASON FOR SUCH ERROR?I AM UNABLE TO FIND THE REASON FOR SUCH ERROR. Regards,TheVoice Link to comment Share on other sites More sharing options...
lucianc Posted May 21, 2008 Share Posted May 21, 2008 thevoice wrote:WHAT IS REASON FOR SUCH ERROR?I AM UNABLE TO FIND THE REASON FOR SUCH ERROR. Are you trying to update an existing resource, or save an JRXML as a new resource? The error seems to indicate that the resource is not found on the server, so if you're saving a new resource, make sure you set the "new" flag to true:Code:rdis.setIsNew(true); HTH,Lucian Link to comment Share on other sites More sharing options...
thevoice Posted May 22, 2008 Author Share Posted May 22, 2008 Hi lucianc, Thank you very much for your reply :) Well,from my ruby application,i try to update existing resource. When i run java program from command prompt then its run without giving any error and also update resource on the server. Problem comes when i run my java program from ruby on rails. SO,PLEASE HELP ME TO SOLVE THIS ERROR :) Regards,TheVoice Link to comment Share on other sites More sharing options...
thevoice Posted May 22, 2008 Author Share Posted May 22, 2008 Hello there, The error related to resource not found is get solve. After tracking execution of my report from ruby application i find that resource name from my ruby application to my java program is not pass properly. So i correct it and my error get solved :) Regards,TheVoice Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now