Jump to content
We've recently updated our Privacy Statement, available here ×

java main compiler error. Where can I find the irplugin jar files?


kburns

Recommended Posts

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 exist
import com.jaspersoft.jasperserver.irplugin.JServer;
                                           ^
MyJSClient.java:4: package com.jaspersoft.jasperserver.irplugin.wsclient does not exist
import com.jaspersoft.jasperserver.irplugin.wsclient.WSClient;
                                                    ^
MyJSClient.java:9: cannot find symbol
symbol  : class JServer
location: class MyJSClient
    private JServer server = null;
            ^
MyJSClient.java:11: cannot find symbol
symbol  : class JServer
location: class MyJSClient
    server = new JServer();
                 ^
MyJSClient.java:20: cannot find symbol
symbol  : class WSClient
location: class MyJSClient
    WSClient MyWSClient = server.getWSClient();
    ^
5 errors

 

Any ideas where I can find these packages?

com.jaspersoft.jasperserver.irplugin.JServer
com.jaspersoft.jasperserver.irplugin.wsclient.WSClient

 

Thanks!

Link to comment
Share on other sites

  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

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.impl
import com.jaspersoft.ireport.jasperserver.JServer
import com.jaspersoft.ireport.jasperserver.ws.WSClient

The necessary jars needed in the classpath are:

com-jaspersoft-ireport-jasperserver.jar (in \ireport\modules)

and all its dependencies located in \ireport\modules\ext

js_activation-1.1.jar
js_axis-1.4patched.jar
js_commons-codec-1.3.jar
js_commons-discovery-0.2.jar
js_commons-httpclient-3.1.jar
js_jasperserver-common-ws-3.5.0.jar
js_jaxrpc.jar
js_mail-1.4.jar
js_saaj-api-1.3.jar
js_wsdl4j-1.5.1.jar

 

 

Link to comment
Share on other sites

  • 2 months later...

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

I am curious if you were able to compile the sample: java-webapp-sample.

It's located here:

  <js-ce-src>/samples/java-webapp-sample

The 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

  • 1 month later...

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.jar

But after all it ends up with the earlier mentioned

15:39:11,310 ERROR [sTDERR] 05.07.2011 15:39:11 org.openide.util.NbPreferences getPreferencesProvider
WARNUNG: 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?

Regards

Benjamin

Link to comment
Share on other sites

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

Link to comment
Share on other sites

 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.0

the only problem i have with this is that the responses are slow from time to time. 

Link to comment
Share on other sites

bsteimer
Wrote:

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?

 

Thanks

Oliver

 



Post Edited by olivert at 07/11/2011 10:53
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...