i'm using netbeans to create webservice to get the report from jasperserver,now i'm facing this problem
org.openide.util.NbPreferences getPreferencesProvider
WARNING: NetBeans implementation of Preferences not found
and i ady include the org.openide.util jar and org.openide.util.loopup jar..i have no idea to fix it.
package pdfprint;
import java.util.HashMap;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.engine.export.JRPdfExporterPa rameter;
import com.jaspersoft.jasperserver.api.metadata.xml.domai n.impl.ResourceDescriptor;
import com.jaspersoft.ireport.jasperserver.JServer;
import com.jaspersoft.ireport.jasperserver.ws.WSClient;
import java.util.Locale;
import net.sf.jasperreports.view.JasperViewer;
public class Pdfprint {
public static void main (String[] args) throws Exception {
JServer server = new JServer();
server.setUrl("http://localhost:8080/jasperserver/services/repository");
server.setUsername("jasperadmin");
server.setPassword("jasperadmin");
WSClient client = server.getWSClient();
//System.out.println("Version Check: " + client.getVersion());
ResourceDescriptor rd = new ResourceDescriptor();
rd.setWsType(ResourceDescriptor.TYPE_REPORTUNIT);
rd.setUriString("/reports/samples/AllAccounts");
//ResourceDescriptor asd = new ResourceDescriptor();
HashMap params = new HashMap();
params.put("Plb_Company", "Company");
params.put("Plb_Address", "Address");
params.put("Plb_Title","Title");
params.put("PCondition","SELECT * FROM v_doc_ticketing WHERE f_doc_no='MYCSB0000096'");
//System.out.print("124567");
//System.exit(0);
//System.out.println(params);
JasperPrint jp = client.runReport(rd, params);
JasperViewer.viewReport(jp, false,Locale.GERMAN);
JRPdfExporter exporter = new JRPdfExporter();
exporter.setParameter(JRPdfExporterParameter.JASPE R_PRINT, jp);
}
}
this is the full error i'm facing
org.openide.util.NbPreferences getPreferencesProvider
WARNING: NetBeans implementation of Preferences not found
[INFO] AuthChallengeProcessor - -basic authentication scheme selected
Exception in thread "main" java.lang.NullPointerException
at net.sf.jasperreports.engine.JROrigin.equals(JROrig in.java:143)
at java.util.HashMap.putForCreate(HashMap.java:522)
at java.util.HashMap.readObject(HashMap.java:1156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at java.io.ObjectStreamClass.invokeReadObject(ObjectS treamClass.java:1004)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1872)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1777)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1347)
at java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1970)
at java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1894)
at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1777)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1347)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:369)
at net.sf.jasperreports.engine.util.JRLoader.loadObje ct(JRLoader.java:198)
at com.jaspersoft.ireport.jasperserver.ws.WSClient.ru nReport(WSClient.java:337)
at pdfprint.Pdfprint.main(Pdfprint.java:42)