kburns Posted March 2, 2011 Share Posted March 2, 2011 I've successfully build jasper server professional 4.0 from source and am now having some problems finding packages contained therein. MyJSClient.java is a very simple main(). When I try to compile I get this:MyJSClient.java:3: package com.jaspersoft.jasperserver.irplugin does not existimport com.jaspersoft.jasperserver.irplugin.JServer; ^MyJSClient.java:4: package com.jaspersoft.jasperserver.irplugin.wsclient does not existimport com.jaspersoft.jasperserver.irplugin.wsclient.WSClient; ^MyJSClient.java:9: cannot find symbolsymbol : class JServerlocation: class MyJSClient private JServer server = null; ^MyJSClient.java:11: cannot find symbolsymbol : class JServerlocation: class MyJSClient server = new JServer(); ^MyJSClient.java:20: cannot find symbolsymbol : class WSClientlocation: class MyJSClient WSClient MyWSClient = server.getWSClient(); ^5 errors Any ideas where I can find these packages? com.jaspersoft.jasperserver.irplugin.JServercom.jaspersoft.jasperserver.irplugin.wsclient.WSClient Thanks! Link to comment Share on other sites More sharing options...
kburns Posted March 4, 2011 Author Share Posted March 4, 2011 The above was based on the 4.0 web services documentation. However that documentation is actually content for 3.5 and completely obsolete and incorrect. The correct imports are:import com.jaspersoft.jasperserver.api.metadata.xml.domain.implimport com.jaspersoft.ireport.jasperserver.JServerimport com.jaspersoft.ireport.jasperserver.ws.WSClientThe necessary jars needed in the classpath are:com-jaspersoft-ireport-jasperserver.jar (in \ireport\modules)and all its dependencies located in \ireport\modules\extjs_activation-1.1.jarjs_axis-1.4patched.jarjs_commons-codec-1.3.jarjs_commons-discovery-0.2.jarjs_commons-httpclient-3.1.jarjs_jasperserver-common-ws-3.5.0.jarjs_jaxrpc.jarjs_mail-1.4.jarjs_saaj-api-1.3.jarjs_wsdl4j-1.5.1.jar Link to comment Share on other sites More sharing options...
sheppard.deangmail.com Posted May 10, 2011 Share Posted May 10, 2011 Awesome, was looking for the same info. Link to comment Share on other sites More sharing options...
sheppard.deangmail.com Posted May 10, 2011 Share Posted May 10, 2011 What jar is JasperPrint defined in? I seem to be missing that one. Link to comment Share on other sites More sharing options...
sheppard.deangmail.com Posted May 10, 2011 Share Posted May 10, 2011 Never mind, guess it make sense to also include the jasperreports-4.0.2.jar file :) Link to comment Share on other sites More sharing options...
sheppard.deangmail.com Posted May 11, 2011 Share Posted May 11, 2011 I've included these jar, but also required the commons-logging-1.0.4.jar. When I attempt to run the runReport method, I get the following exception; Exception in thread "main" java.lang.NoClassDefFoundError: org/openide/util/Lookup at com.jaspersoft.ireport.jasperserver.ws.WSClient.getManagementService(WSClient.java:642) at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:399) at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:320) at MyJIClient.runReport(MyJIClient.java:36) at MyJIClient.main(MyJIClient.java:43) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:110) Am I missing a jar? I can't find this. If I choose a random openide.jar from the net, i then get an error as follows; Exception in thread "main" java.lang.NoClassDefFoundError: org/openide/util/NbPreferences at com.jaspersoft.ireport.designer.IReportManager.getPreferences(IReportManager.java:1245) at com.jaspersoft.ireport.jasperserver.ws.WSClient.getManagementService(WSClient.java:642) at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:399) at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:320) at MyJIClient.runReport(MyJIClient.java:34) at MyJIClient.main(MyJIClient.java:43) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:110)Caused by: java.lang.ClassNotFoundException: org.openide.util.NbPreferences at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) Code:import com.jaspersoft.ireport.jasperserver.JServer;import com.jaspersoft.ireport.jasperserver.ws.WSClient;import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor;import net.sf.jasperreports.engine.JasperPrint;import java.util.HashMap;/** * Created by IntelliJ IDEA. User: dean Date: May 10, 2011 Time: 1:03:04 PM To change this template use File | Settings * | File Templates. */public class MyJIClient{ private JServer server = null; public MyJIClient(String webServiceUrl, String username, String password) { server = new JServer(); server.setUsername(username); server.setPassword(password); server.setUrl(webServiceUrl); } public void runReport(String reportUri, java.util.Map parameters) throws Exception { ResourceDescriptor rd = new ResourceDescriptor(); rd.setWsType(ResourceDescriptor.TYPE_REPORTUNIT); rd.setUriString(reportUri); WSClient client = server.getWSClient(); JasperPrint print = client.runReport(rd, parameters); } public static void main(String[] args) throws Exception { MyJIClient rp = new MyJIClient("http://192.168.2.16:8080/jasperserver", "jasperadmin", "jasperadmin"); rp.runReport("/reports/test", new HashMap()); }} Link to comment Share on other sites More sharing options...
wichogg Posted May 15, 2011 Share Posted May 15, 2011 have you already try to find the jar or the lookup.java file in the repository maven? maeby that could help you Link to comment Share on other sites More sharing options...
tkavanagh Posted May 17, 2011 Share Posted May 17, 2011 I am curious if you were able to compile the sample: java-webapp-sample.It's located here: <js-ce-src>/samples/java-webapp-sampleThe build process is a maven build process. If you have already successfully compiled the JS CE source then all the required dependencies should be in place for the java-webapp-sample. Link to comment Share on other sites More sharing options...
bsteimer Posted July 5, 2011 Share Posted July 5, 2011 Did anyone get the WSClient example got to work under JasperServer 4.0+? I found the so called documentary the Webservices Guide but although it says it's for version 4.0 I can't belive this because there are referenced many jar's which aren't shipped with the current JasperServer version anymore.So what I did is to copy the following jar files into WEB-INF/lib: jasperreports-4.0.2.jar jasperreports-applet-4.0.2.jar jasperreports-javaflow-4.0.2.jar jasperserver-common-ws-4.1.0.jar com-jaspersoft-ireport-jasperserver.jar com-jaspersoft-ireport.jar ord-openide-util.jarBut after all it ends up with the earlier mentioned15:39:11,310 ERROR [sTDERR] 05.07.2011 15:39:11 org.openide.util.NbPreferences getPreferencesProviderWARNUNG: NetBeans implementation of Preferences not found: java.lang.Exception at org.openide.util.NbPreferences.getPreferencesProvider(NbPreferences.java:110) at org.openide.util.NbPreferences.forModule(NbPreferences.java:75) at com.jaspersoft.ireport.designer.IReportManager.getPreferences(IReportManager.java:1245) at com.jaspersoft.ireport.jasperserver.ws.WSClient.getManagementService(WSClient.java:642) So does anyone have an idea how to use the WSClient under JasperServer 4.0+ CE or where I can get some examples oder documentary?RegardsBenjamin Link to comment Share on other sites More sharing options...
wichogg Posted July 5, 2011 Share Posted July 5, 2011 I have a working example of the WSCLIENT provied by jasperforge. download the attachmet and add the necesary libraries asked by netbeans 7.0hope this will help you. Link to comment Share on other sites More sharing options...
bsteimer Posted July 6, 2011 Share Posted July 6, 2011 Hi wichogg,thanks for your reply. It got me to the solution although it seems not logical to me using a jar file (jasperserver-ireport-plugin-3.7.0.jar) from an old JasperServer version which is actually not provided which JasperServer 4.0. But it works :-)So thanks a lotRegardsBenjamin Link to comment Share on other sites More sharing options...
wichogg Posted July 6, 2011 Share Posted July 6, 2011 It didnt seem logic for me too, but the jasperserver-ireport-plugin-3.7.0.jar was the only jar i found in te repository maven for jaseper server 4.0the only problem i have with this is that the responses are slow from time to time. Link to comment Share on other sites More sharing options...
olivert Posted July 11, 2011 Share Posted July 11, 2011 bsteimerWrote: Hi wichogg, thanks for your reply. It got me to the solution although it seems not logical to me using a jar file (jasperserver-ireport-plugin-3.7.0.jar) from an old JasperServer version which is actually not provided which JasperServer 4.0. But it works :-) So thanks a lot Regards Benjamin Hi Benjamin, did you find a working solution with version 4? ThanksOliver Post Edited by olivert at 07/11/2011 10:53 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