Applet error - java.lang.NoClassDefFoundError: sun/misc/ProxyGenerator - java

I am running an applet from browser and am getting error:
sun/misc/ProxyGenerator
java.lang.NoClassDefFoundError: sun/misc/ProxyGenerator
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Unknown Source)
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Unknown Source)
at java.lang.reflect.WeakCache$Factory.get(Unknown Source)
at java.lang.reflect.WeakCache.get(Unknown Source)
at java.lang.reflect.Proxy.getProxyClass0(Unknown Source)
at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
at sun.reflect.annotation.AnnotationParser.annotationForMap(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(Unknown Source)
at java.lang.Class.initAnnotationsIfNecessary(Unknown Source)
at java.lang.Class.getAnnotation(Unknown Source)
at sun.reflect.annotation.AnnotationType.<init>(Unknown Source)
at sun.reflect.annotation.AnnotationType.getInstance(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(Unknown Source)
at java.lang.Class.initAnnotationsIfNecessary(Unknown Source)
at java.lang.Class.getAnnotation(Unknown Source)
at com.thoughtworks.xstream.mapper.AnnotationMapper$UnprocessedTypesSet.add(AnnotationMapper.java:481)
at com.thoughtworks.xstream.mapper.AnnotationMapper$UnprocessedTypesSet.add(AnnotationMapper.java:466)
at com.thoughtworks.xstream.mapper.AnnotationMapper.processAnnotations(AnnotationMapper.java:142)
at com.thoughtworks.xstream.XStream.processAnnotations(XStream.java:1576)
at com.thoughtworks.xstream.XStream.processAnnotations(XStream.java:1587)
at com.plugin.PluginReader.getOptionalColumnsPluginPOJO(PluginReader.java:242)
at com.applet.GUIValuesApplet.getOptionalColumns(GUIValuesApplet.java:177)
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.plugin.javascript.Trampoline.invoke(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.plugin.javascript.JSClassLoader.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass$MethodInfo.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass$MemberBundle.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass.invoke0(Unknown Source)
at sun.plugin2.liveconnect.JavaClass.invoke(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$DefaultInvocationDelegate.invoke(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo.doObjectOp(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$LiveConnectWorker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
If I run this applet from eclipse, it runs fine. I suspect there may be issue with jre version or accessing rt.jar in jre runtime. This is not code related issue for sure as everything was working until my system got restarted (it reboots per company policy on weekend). Therefore, any setting may have been changed.
Browser used: Chrome
latest version of jre on machine: jre7
code compiled using: jre6
Kindly respond as I have been facing this issue for long time now.
UPDATE:
Just to add, I get this error when I try to read xml file to Java class using annotaions in thoughtworks xstream lib

sun.misc is a vendor specific class which should not be used in portable Java code.
Either make the code portable or switch the browser plugin to the Oracle JVM.

Looks my jre installation got corrupt. I reinstalled it and it fixed the issue.

Related

SpreadsheetView Error - controlsfx

I used spreadsheet view of controlsfx 8.0.6U25 with earlier jdk for my work and it worked good. Recently I updated to JDK 8U40 and controlsfx 8.20.8. Sadly, the spreadsheet view won't load. I get error in my IDE anytime I run the same project. Please, has anyone faced the same problem? What is the solution? Thank you.
Please find the error I get below. I made no changes before the update.
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$152(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$71/1915503092.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.InstantiationError: com.sun.javafx.scene.control.SelectedCellsMap
at impl.org.controlsfx.spreadsheet.SpreadsheetViewSelectionModel.<init>(SpreadsheetViewSelectionModel.java:198)
at org.controlsfx.control.spreadsheet.SpreadsheetView.<init>(SpreadsheetView.java:395)
at myStudentAssessNew.StudentAsessment$8.<init>(StudentAsessment.java:920)
at myStudentAssessNew.StudentAsessment.addhboxCenter(StudentAsessment.java:920)
at myStudentAssessNew.StudentAsessment.start(StudentAsessment.java:353)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$92/717936956.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/186276003.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/1232900564.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/237061348.run(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$145(Unknown Source)
at com.sun.glass.ui.win.WinApplication$$Lambda$36/2117255219.run(Unknown Source)
... 1 more
Exception running application myStudentAssessNew.StudentAsessment
Well, the solution rather looks simple. Since controlsfx project has not yet been updated to meet JDK 8u40 and above as at now, I just reinstalled the previous jdk (JDK 8u25) and I am okay now.

In Install4j, what can I do to fix an java.lang.OutOfMemoryError caused by installing too many installers with too many files?

Some of our testers using the Install4j installers that we produce, are receiving an OurOfMemoryError part way through the process. After a closer inspection, we've narrowed it down to the .install4j/files.log file that Install4j generates. The cumulative entries in this file from all the installers that they run has caused the file to grow larger than 27mb.
My question is what can I do to manage this file so that I don't have this OutOfMemoryError occur anymore? Do I simply have to clear it before every install, or is there a way I can override it to not generate anything at all?
As an alternative, is there any reason I couldn't or shouldn't just delete the .install4j directory?
Here is the stacktrace leading up to the OutOfMemoryError.
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.lang.StringValue.from(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at java.io.Win32FileSystem.resolve(Unknown Source)
at java.io.File.<init>(Unknown Source)
at com.install4j.runtime.installer.helper.fileinst.FileLogger.readEntries(Unknown Source)
at com.install4j.runtime.installer.helper.fileinst.FileLogger.read(Unknown Source)
at com.install4j.runtime.installer.helper.fileinst.MainFileInstallerState.setLogDir(Unknown Source)
at com.install4j.runtime.installer.helper.fileinst.FileInstaller.setLogDir(Unknown Source)
at com.install4j.runtime.beans.actions.InstallFilesAction.install(Unknown Source)
at com.install4j.runtime.installer.InstallerContextImpl$2.fetchValue(Unknown Source)
at com.install4j.runtime.installer.helper.comm.actions.FetchObjectAction.execute(Unknown Source)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionDirect(Unknown Source)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionInt(Unknown Source)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionChecked(Unknown Source)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.fetchObjectChecked(Unknown Source)
at com.install4j.runtime.installer.InstallerContextImpl.performActionIntStatic(Unknown Source)
at com.install4j.runtime.installer.InstallerContextImpl.performActionInt(Unknown Source)
at com.install4j.runtime.installer.ContextImpl.performAction(Unknown Source)
at com.install4j.runtime.installer.controller.Controller.executeActions(Unknown Source)
at com.install4j.runtime.installer.controller.Controller.handleCommand(Unknown Source)
at com.install4j.runtime.installer.controller.Controller.start(Unknown Source)
at com.install4j.runtime.installer.Installer.runInProcess(Unknown Source)
at com.install4j.runtime.installer.Installer.main(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 com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.exe4j.runtime.WinLauncher.main(Unknown Source)
at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
On the "Installer->Screens & Actions" step, select the installer and add
-Xmx512m
to the "VM parameters" property. If that does not help add -XX:+HeapDumpOnOutOfMemoryError and post the zipped HPROF snapshot.

java.lang.NoClassDefFoundError on soapUI installation

I'm trying to install soapUI on my laptop and am getting the following error:
Starting Installer ...
java.lang.NoClassDefFoundError: java.awt.Container
at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(Unknown Source)
at com.install4j.runtime.installer.frontend.headless.ConsoleScreenExecutor.(Unknown Source)
at com.install4j.runtime.installer.frontend.headless.InstallerConsoleScreenExecutor.(Unknown Source)
at com.install4j.runtime.installer.Installer.getScreenExecutor(Unknown Source)
at com.install4j.runtime.installer.Installer.runInProcess(Unknown Source)
at com.install4j.runtime.installer.Installer.main(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 com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unknown Source)
java.lang.NoClassDefFoundError: java.awt.Component
at javax.swing.ImageIcon$2.run(Unknown Source)
at javax.swing.ImageIcon$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.swing.ImageIcon.createNoPermsComponent(Unknown Source)
at javax.swing.ImageIcon.access$000(Unknown Source)
at javax.swing.ImageIcon$1.run(Unknown Source)
at javax.swing.ImageIcon$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.swing.ImageIcon.(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper.loadIcon(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper.(Unknown Source)
at com.install4j.runtime.installer.helper.InstallerUtil.reportException(Unknown Source)
at com.install4j.runtime.installer.Installer.main(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 com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unknown Source)
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
at javax.swing.ImageIcon.(Unknown Source)
at javax.swing.ImageIcon.(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper.loadIcon(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper.(Unknown Source)
at com.install4j.runtime.installer.helper.InstallerUtil.reportException(Unknown Source)
at com.install4j.runtime.installer.Installer.main(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 com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unknown Source)
Not sure what's going on. Any ideas would be much appreciated.
AFAIK SoapUI is distributed with its own JRE. From the stacktrace it appears that the application cannot find the runtime jar (rt.jar). Its probably easier to download a new copy of the test tool to resolve this.
If the JAVA_HOME environmental variable is that is set SoapUI uses the JRE installed at that location otherwise it uses its own copy. Its possible that JAVA_HOME is pointing to a JRE which has a corrupt runtime JAR file.
Try clearing this environmental variable or setting it to an another JRE
If you have Java correctly installed on your system, just use the zip version.
You may need to set your JAVA_HOME variable if you continue to see the same error.
Zip versions for every platform are available here.
Just extract the zip, and run bin/soapui.sh

NPE with logging while launching webstart on jre7 update 40

My application was running fine until I upgraded my jre to 7u40. When my application is initializing, it's doing Logger.getLogger("ClassName"), and I'm getting the following exception.
java.lang.ExceptionInInitializerError
at java.util.logging.Logger.demandLogger(Unknown Source)
at java.util.logging.Logger.getLogger(Unknown Source)
at com.company.Application.Applet.<clinit>(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 com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at java.util.logging.Logger.setParent(Unknown Source)
at java.util.logging.LogManager$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.doSetParent(Unknown Source)
at java.util.logging.LogManager.access$1100(Unknown Source)
at java.util.logging.LogManager$LogNode.walkAndSetParent(Unknown Source)
at java.util.logging.LogManager$LoggerContext.addLocalLogger(Unknown Source)
at java.util.logging.LogManager$LoggerContext.addLocalLogger(Unknown Source)
at java.util.logging.LogManager.addLogger(Unknown Source)
at java.util.logging.LogManager$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(Unknown Source)
The exception is coming from this line:
private static Logger logger = Logger.getLogger(Applet.class.getName());
Could it be because of any sideeffects with fix http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8017174 ?
A workaround is to open the java control center and enable logging. This is a concern since by default "Enable Logging" is unchecked. If I select "Enable Logging", the application starts fine.
This problem seems to be fixed in java7 update 45.
Try to package java.util.logging.* with your app in a JAR, and make sure it's on the classpath. That way it is always available. Also, what does your logging.properties look like?

Install4j is bypassing the custom installation steps

We have an application packed with install4j.
The initial step is to choose between typical and custom installations.
The custom installation is usually bringing up the option to choose the localsettings folder, the appdata folder and in the next step, the installation folder (default: Program Files).
For some reason, in a specific environment, when checking neither of the options, the installation proceeds without asking for the desired folder paths.
An error file was created as well:
java.lang.ClassNotFoundException: I4jScript_Internal_12
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 com.install4j.runtime.installer.ContextImpl.runScript(Unknown Source)
at com.install4j.runtime.installer.ContextImpl.runScript(Unknown Source)
at com.install4j.runtime.installer.ContextImpl.runBooleanScript(Unknown Source)
at com.install4j.runtime.installer.ContextImpl.runBooleanScript(Unknown Source)
at com.install4j.runtime.installer.ContextImpl.runBooleanScript(Unknown Source)
at com.install4j.runtime.installer.controller.Controller.executeActions(Unknown Source)
at com.install4j.runtime.installer.controller.Controller.handleCommand(Unknown Source)
at com.install4j.runtime.installer.controller.Controller.start(Unknown Source)
at com.install4j.runtime.installer.Installer.main(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 com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.exe4j.runtime.WinLauncher.main(Unknown Source)
at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
Could you please let me know, what could be the reason for this behavior?
The class that is not found is for a script in your install4j project. This can only happen if there is an inconsistency in your installation directory, i.e. if .install4j/user.jar and .install4j/i4jparams.conf are not from the same installer.

Categories

Resources