Hello Friend's plz help me on this. When i run this code in my java file
code: Parent root=FXMLLoader.load(getClass().getResource("first.fxml"));
to get the fxml file that contain the Java Builder code, then i face these Problems. My code is not run. Problems are:
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Location is required.
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at firt.first.start(first.java:17)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(Unknown Source)
... 1 more
Exception running application firt.first
Plz help me, guide me what to do ......
In your exception it says "Caused by: java.lang.NullPointerException: Location is required."
You have to set the correct location of your fxml file.
Parent root=FXMLLoader.load(getClass().getResource("first.fxml"));
According to your code, your fxml file is expected to be in the same folder like your .java file on the system.
Related
Exception in thread "main" java.lang.UnsatisfiedLinkError: /data/data/ru.iiec.jvdroid/files/lib/libfontmanager.so: dlopen failed: library "libfreetype.so" not found
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(Unknown Source)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.base/java.lang.Runtime.loadLibrary0(Unknown Source)
at java.base/java.lang.System.loadLibrary(Unknown Source)
at java.desktop/sun.font.FontManagerNativeLibrary$1.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/sun.font.FontManagerNativeLibrary.<clinit>(Unknown Source)
at java.desktop/sun.font.SunFontManager$1.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/sun.font.SunFontManager.<clinit>(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Unknown Source) at java.desktop/sun.font.FontManagerFactory$1.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/sun.font.FontManagerFactory.getInstance(Unknown Source)
at java.desktop/java.awt.Font.getFont2D(Unknown Source)
at java.desktop/java.awt.Font$FontAccessImpl.getFont2D(Unknown Source)
at java.desktop/sun.font.FontUtilities.getFont2D(Unknown Source)
at java.desktop/sun.java2d.SunGraphics2D.checkFontInfo(Unknown Source)
at java.desktop/sun.java2d.SunGraphics2D.getFontInfo(Unknown Source)
at java.desktop/sun.java2d.pipe.GlyphListPipe.drawString(Unknown Source)
at java.desktop/sun.java2d.pipe.ValidatePipe.drawString(Unknown Source)
at java.desktop/sun.java2d.SunGraphics2D.drawString(Unknown Source)
at Main.main(Main.java:13)
This exception is thrown when calling Graphics2D#drawString, this code is executed in the IDE JvDroid, Android 10, Honor 10 lite. Is there any way to install this library (maybe load using the System methods)
I have been working on an application with JavaFX and spring boot, it workes fine when I launch it from the Eclipse IDE but if I run the generated jar using :
java -jar AppXX.jar it gives me the error below:
Exception in Application init method
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.RuntimeException: Exception in Application init method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: javafx.fxml.LoadException:
file:/C:/Users/XX/target/MDV2.0-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/com/X/anotherProject/view/Welcome.fxml
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.X.anotherProject.AnotherProjectApplication.init(AnotherProjectApplication.java:42)
... 3 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.reflect.Trampoline.invoke(Unknown Source)
at jdk.internal.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(Unknown Source)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(Unknown Source)
... 7 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(Unknown Source)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at javafx.base/javafx.event.Event.fireEvent(Unknown Source)
at javafx.graphics/javafx.scene.Node.fireEvent(Unknown Source)
at com.X.anotherProject.Controller.WelcomeController.FireAnEvent(WelcomeController.java:464)
at com.X.anotherProject.Controller.WelcomeController.initialize(WelcomeController.java:338)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.reflect.Trampoline.invoke(Unknown Source)
at jdk.internal.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(Unknown Source)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(Unknown Source)
... 31 more
Caused by: javafx.fxml.LoadException:
file:/C:/Users/XX/target/MDV2.0-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/com/X/anotherProject/view/Kits%20de%20migration.fxml
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.sopraMdv.anotherProject.Controller.WelcomeController.loadInMainPane(WelcomeController.java:453)
at com.X.anotherProject.Controller.WelcomeController.press(WelcomeController.java:398)
... 41 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.reflect.Trampoline.invoke(Unknown Source)
at jdk.internal.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(Unknown Source)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(Unknown Source)
... 46 more
Caused by: java.lang.IllegalStateException: Location is not set.
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at com.X.anotherProject.Controller.WelcomeController.loadInMainPane(WelcomeController.java:453)
at com.X.anotherProject.Controller.KitListController.AddElemnt(KitListController.java:115)
at com.X.anotherProject.Controller.KitListController.initialize(KitListController.java:98)
... 56 more
this is how I load the FXML file in my class :
public static void main(String[] args) {
Application.launch(args);
}
#Override
public void init() throws Exception {
springContext = SpringApplication.run(AnotherProjectApplication.class);
FXMLLoader fxmlLoader= new FXMLLoader(getClass().getResource("/com/X/anotherProject/view/Welcome.fxml"));
springContext.getAutowireCapableBeanFactory().autowireBean(this);
fxmlLoader.setControllerFactory(AnotherProjectApplication.springContext::getBean);
rootNode=fxmlLoader.load();
}
note that I have checked a lot of related problems and none of them worked.
The thing is that getClass().getResource() cannot find the FXML file.
When I opened the jar with Winrar I found the file in the given path :
file:/C:/Users/XX/target/MDV2.0-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/com/X/anotherProject/view/Welcome.fxml
Here i have my artifact output layout. I included jfoenix lib so i don't have any problems with running my project.
Build was successful. Now i have these files in my artifacts folder
And when i run my jar file i still get this output
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/css/StyleConverterImpl
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at com.jfoenix.controls.JFXButton$StyleableProperties.<clinit>(JFXButton.java:208)
at com.jfoenix.controls.JFXButton.<init>(JFXButton.java:156)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.base/java.lang.Class.newInstance(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at main.Main.start(Main.java:15)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
... 1 more
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.StyleConverterImpl
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 37 more
Exception running application main.Main
I use jdk1.8_171 and run using jre1.8_171. What's the problem here?
Comment by fabian is correct. i was actually running my app with Java >= 9. Adding jfoenix lib for Java 9 solved the problem.
I created quite complex project with JavaFX and now I'm having some trouble deploying it, as I never deployed any app in Java before.
I tried using Intellij "Build artificial" but I always get "Error: corrupted jarfile" when I try to open the the Jar it builds.
Any suggestions? I'm using external libraries from Maven and some local ones too if it helps...
Edit:
Ok I changed some of the settings in the Make Artificial, now I don't get that error.
I get this Exception, seems it can't file the fxml file...
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Location is required.
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at sample.Main.start(Main.java:20)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
at
javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
... 1 more
Exception running application sample.Main
SOLVED!: just played with the fxml files patches and it fixed it...
I am using Sugar CRM version 6.5.16 and I installed the Zucker Reports module in order to generate reports. The demo reports that came with the Zucker Reports package had been generating reports without any issues (i.e the 'Opportunities' report) and so I have started to create my own custom reports to use within the application using iReports 5.6.0.
I developed a report using the same database as what my CRM application uses and the data was being displayed as I wanted and have therefore I've been trying to deploy the report onto the CRM application to use within the web page. After deploying I was getting the following error whn attempting to run the report.
cmdline: java -Djava.awt.headless=true -classpath "custom/ZuckerReports2/resources/;custom/ZuckerReports2/resources/CustomAccounts2.jasper_files/;modules/zr2_Report/jasper/ant-1.7.1.jar;modules/zr2_Report/jasper/antlr-2.7.5.jar;modules/zr2_Report/jasper/barbecue-1.5-beta1.jar;modules/zr2_Report/jasper/barcode4j-2.0.jar;modules/zr2_Report/jasper/batik-anim.jar;modules/zr2_Report/jasper/batik-awt-util.jar;modules/zr2_Report/jasper/batik-bridge.jar;modules/zr2_Report/jasper/batik-css.jar;modules/zr2_Report/jasper/batik-dom.jar;modules/zr2_Report/jasper/batik-ext.jar;modules/zr2_Report/jasper/batik-gvt.jar;modules/zr2_Report/jasper/batik-parser.jar;modules/zr2_Report/jasper/batik-script.jar;modules/zr2_Report/jasper/batik-svg-dom.jar;modules/zr2_Report/jasper/batik-svggen.jar;modules/zr2_Report/jasper/batik-util.jar;modules/zr2_Report/jasper/batik-xml.jar;modules/zr2_Report/jasper/bcel-5.2.jar;modules/zr2_Report/jasper/bsh-2.0b4.jar;modules/zr2_Report/jasper/commons-beanutils-1.8.0.jar;modules/zr2_Report/jasper/commons-collections-2.1.1.jar;modules/zr2_Report/jasper/commons-digester-1.7.jar;modules/zr2_Report/jasper/commons-javaflow-20060411.jar;modules/zr2_Report/jasper/commons-logging-1.0.4.jar;modules/zr2_Report/jasper/groovy-all-1.7.5.jar;modules/zr2_Report/jasper/hibernate3.jar;modules/zr2_Report/jasper/hsqldb-1.8.0-10.jar;modules/zr2_Report/jasper/iText-2.1.7.jar;modules/zr2_Report/jasper/jasperreports-4.0.0.jar;modules/zr2_Report/jasper/jasperreports-applet-4.0.0.jar;modules/zr2_Report/jasper/jasperreports-fonts-4.0.0.jar;modules/zr2_Report/jasper/jasperreports-javaflow-4.0.0.jar;modules/zr2_Report/jasper/jaxen-1.1.1.jar;modules/zr2_Report/jasper/jcommon-1.0.15.jar;modules/zr2_Report/jasper/jdt-compiler-3.1.1.jar;modules/zr2_Report/jasper/jfreechart-1.0.12.jar;modules/zr2_Report/jasper/jpa.jar;modules/zr2_Report/jasper/jxl-2.6.10.jar;modules/zr2_Report/jasper/log4j-1.2.15.jar;modules/zr2_Report/jasper/mondrian-3.1.1.12687.jar;modules/zr2_Report/jasper/mysql-connector-java-3.1.11-bin.jar;modules/zr2_Report/jasper/png-encoder-1.5.jar;modules/zr2_Report/jasper/poi-3.6.jar;modules/zr2_Report/jasper/rhino-1.7R1.jar;modules/zr2_Report/jasper/saaj-api-1.3.jar;modules/zr2_Report/jasper/serializer.jar;modules/zr2_Report/jasper/servlet.jar;modules/zr2_Report/jasper/spring-beans-2.5.5.jar;modules/zr2_Report/jasper/spring-core-2.5.5.jar;modules/zr2_Report/jasper/xalan-2.7.1.jar;modules/zr2_Report/jasper/xercesImpl-2.7.0.jar;modules/zr2_Report/jasper/xml-apis-ext.jar;modules/zr2_Report/jasper/xml-apis.jar;modules/zr2_Report/jasper/zuckerreports-1.0.jar;" at.go_mobile.zuckerreports.JasperBatchMain custom/ZuckerReports2/temp/dd12eded-b108-ac55-9905-57149d3cb021/cmd.properties 2>&1
JasperBatchMain :: loading jasper design custom/ZuckerReports2/resources/CustomAccounts2.jasper
Exception in thread "main" net.sf.jasperreports.engine.JRRuntimeException: java.lang.ClassNotFoundException: net.sf.jasperreports.engine.ReportContext
at net.sf.jasperreports.engine.base.JRBaseParameter.getValueClass(JRBaseParameter.java:147)
at at.go_mobile.zuckerreports.JasperBatchMain.main(JasperBatchMain.java:117)
Caused by: java.lang.ClassNotFoundException: net.sf.jasperreports.engine.ReportContext
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:175)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:115)
at net.sf.jasperreports.engine.base.JRBaseParameter.getValueClass(JRBaseParameter.java:143)
... 1 more
After reading http://techs.studyhorror.com/sugarcrm-how-install-zucker-reports-i-56 I thought the issue could be down to jar files so I moved all the Jasper jar files the report was using within the iReports application into the CRM application.
and this change was promising as it gave me a different error message:
cmdline: java -Djava.awt.headless=true -classpath "custom/ZuckerReports2/resources/;custom/ZuckerReports2/resources/CustomAccounts2.jasper_files/;modules/zr2_Report/jasper/ant-1.7.1.jar;modules/zr2_Report/jasper/antlr-2.7.5.jar;modules/zr2_Report/jasper/barbecue-1.5-beta1.jar;modules/zr2_Report/jasper/barcode4j-2.0.jar;modules/zr2_Report/jasper/batik-anim.jar;modules/zr2_Report/jasper/batik-awt-util.jar;modules/zr2_Report/jasper/batik-bridge.jar;modules/zr2_Report/jasper/batik-css.jar;modules/zr2_Report/jasper/batik-dom.jar;modules/zr2_Report/jasper/batik-ext.jar;modules/zr2_Report/jasper/batik-gvt.jar;modules/zr2_Report/jasper/batik-parser.jar;modules/zr2_Report/jasper/batik-script.jar;modules/zr2_Report/jasper/batik-svg-dom.jar;modules/zr2_Report/jasper/batik-svggen.jar;modules/zr2_Report/jasper/batik-util.jar;modules/zr2_Report/jasper/batik-xml.jar;modules/zr2_Report/jasper/bcel-5.2.jar;modules/zr2_Report/jasper/bsh-2.0b4.jar;modules/zr2_Report/jasper/commons-beanutils-1.8.0.jar;modules/zr2_Report/jasper/commons-collections-2.1.1.jar;modules/zr2_Report/jasper/commons-digester-1.7.jar;modules/zr2_Report/jasper/commons-javaflow-20060411.jar;modules/zr2_Report/jasper/commons-logging-1.0.4.jar;modules/zr2_Report/jasper/groovy-all-1.7.5.jar;modules/zr2_Report/jasper/hibernate3.jar;modules/zr2_Report/jasper/hsqldb-1.8.0-10.jar;modules/zr2_Report/jasper/iText-2.1.7.jar;modules/zr2_Report/jasper/jasperreports-4.0.0.jar;modules/zr2_Report/jasper/jasperreports-5.6.0.jar;modules/zr2_Report/jasper/jasperreports-applet-4.0.0.jar;modules/zr2_Report/jasper/jasperreports-chart-themes-5.6.0.jar;modules/zr2_Report/jasper/jasperreports-core-renderer.jar;modules/zr2_Report/jasper/jasperreports-extensions-3.5.3.jar;modules/zr2_Report/jasper/jasperreports-fonts-4.0.0.jar;modules/zr2_Report/jasper/jasperreports-fonts-5.6.0.jar;modules/zr2_Report/jasper/jasperreports-functions-5.6.0.jar;modules/zr2_Report/jasper/jasperreports-htmlcomponent-4.7.1.jar;modules/zr2_Report/jasper/jasperreports-htmlcomponent-5.0.1.jar;modules/zr2_Report/jasper/jasperreports-javaflow-4.0.0.jar;modules/zr2_Report/jasper/jasperreports-json.jar;modules/zr2_Report/jasper/jasperreports-jtidy-r938.jar;modules/zr2_Report/jasper/jaxen-1.1.1.jar;modules/zr2_Report/jasper/jcommon-1.0.15.jar;modules/zr2_Report/jasper/jdt-compiler-3.1.1.jar;modules/zr2_Report/jasper/jfreechart-1.0.12.jar;modules/zr2_Report/jasper/joda-time-2.1.jar;modules/zr2_Report/jasper/jpa.jar;modules/zr2_Report/jasper/jxl-2.6.10.jar;modules/zr2_Report/jasper/log4j-1.2.15.jar;modules/zr2_Report/jasper/mondrian-3.1.1.12687.jar;modules/zr2_Report/jasper/mysql-connector-java-3.1.11-bin.jar;modules/zr2_Report/jasper/png-encoder-1.5.jar;modules/zr2_Report/jasper/poi-3.6.jar;modules/zr2_Report/jasper/rhino-1.7R1.jar;modules/zr2_Report/jasper/saaj-api-1.3.jar;modules/zr2_Report/jasper/serializer.jar;modules/zr2_Report/jasper/servlet.jar;modules/zr2_Report/jasper/spring-beans-2.5.5.jar;modules/zr2_Report/jasper/spring-core-2.5.5.jar;modules/zr2_Report/jasper/xalan-2.7.1.jar;modules/zr2_Report/jasper/xercesImpl-2.7.0.jar;modules/zr2_Report/jasper/xml-apis-ext.jar;modules/zr2_Report/jasper/xml-apis.jar;modules/zr2_Report/jasper/zuckerreports-1.0.jar;" at.go_mobile.zuckerreports.JasperBatchMain custom/ZuckerReports2/temp/c6f07bf4-1681-db5e-5243-5714c3143fe4/cmd.properties 2>&1
JasperBatchMain :: loading jasper design custom/ZuckerReports2/resources/CustomAccounts2.jasper
Exception in thread "main" java.lang.ClassCastException: cannot assign instance of net.sf.jasperreports.engine.base.JRBaseTextField to field net.sf.jasperreports.engine.base.JRBaseParagraph.paragraphContainer of type net.sf.jasperreports.engine.JRParagraphContainer in instance of net.sf.jasperreports.engine.base.JRBaseParagraph
at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(Unknown Source)
at java.io.ObjectStreamClass.setObjFieldValues(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
at net.sf.jasperreports.engine.base.JRBaseTextElement.readObject(JRBaseTextElement.java:1366)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.util.ArrayList.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
at net.sf.jasperreports.engine.base.JRBaseReport.readObject(JRBaseReport.java:823)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:97)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:73)
at at.go_mobile.zuckerreports.JasperBatchMain.main(JasperBatchMain.java:108)
EDIT Removed issue with demo report that has been resolved after adding the joda-time jar
EDIT New error message pasted after moving the subreports into the root directory of the Reports directory