org.openide.util.RequestProcessor$SlowItem exception in basic NetBeans plugin - java

I followed a tutorial to build a simple plugin for NetBeans v 7.3.1 ... I know this is an older version of NetBeans but I'm restricted by the software my employer insists on using.
All I have is a simple plugin that loads a toolbar item that consists of a button. But when I run the plugin, I always get the same exception alert in a popup:
A org.openide.util.RequestProcessor$SlowItem exception has occurred.
Please report this at [blah blah website blah blah log file created]
This message hasn't been helpful solving the problem. Here is the log file, which as a Java n00b I've been unable to decipher or understand what is going on in it well enough to figure out why I'm getting this error. And there's little to no info I've been able to find in searches. If I'm reading it right (I'm sure I'm not reading it right) then the error is happening in .jar files where I can't do anything about it. So is there anything I can hope to do to ship a plugin that will run without throwing exceptions? Workaround? Something stupid I missed as a n00b?
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.openide.loaders.FolderInstance$1R
java.lang.NullPointerException
at org.openide.util.Exceptions$AnnException.getMessage(Exceptions.java:238)
at org.openide.util.Exceptions$AnnException.toString(Exceptions.java:321)
at java.util.Objects.toString(Objects.java:159)
at java.lang.Throwable.initCause(Throwable.java:457)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:279)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:286)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:286)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:286)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:286)
at org.openide.util.Exceptions$AnnException.findOrCreate(Exceptions.java:256)
at org.openide.util.Exceptions.attachMessage(Exceptions.java:85)
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:157)
at org.openide.loaders.InstanceDataObject$Ser.instanceClass(InstanceDataObject.java:1338)
at org.openide.loaders.InstanceDataObject.instanceClass(InstanceDataObject.java:809)
at org.openide.awt.MenuBar$LazyMenu$MenuFolder.acceptCookie(MenuBar.java:808)
at org.openide.loaders.FolderInstance.acceptDataObject(FolderInstance.java:419)
at org.openide.loaders.FolderInstance.defaultProcessObjects(FolderInstance.java:795)
at org.openide.loaders.FolderInstance.access$000(FolderInstance.java:103)
at org.openide.loaders.FolderInstance$1R.init(FolderInstance.java:693)
at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:720)
Caused: org.openide.util.RequestProcessor$SlowItem: task failed due to
at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:1473)
at org.openide.loaders.FolderInstance.processObjects(FolderInstance.java:768)
at org.openide.loaders.FolderInstance$Listener.finished(FolderInstance.java:1052)
at org.openide.loaders.FolderList.createBoth(FolderList.java:923)
at org.openide.loaders.FolderList.getObjects(FolderList.java:608)
at org.openide.loaders.FolderList.access$200(FolderList.java:77)
at org.openide.loaders.FolderList$ListTask.computeResult(FolderList.java:1007)
at org.openide.loaders.FolderList$ListTask.run(FolderList.java:983)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)
WARNING [org.netbeans.ProxyClassLoader]: Will not load class org.netbeans.modules.editor.NbCodeFoldingAction arbitrarily from one of ModuleCL#183d64f7[org.netbeans.modules.editor] and ModuleCL#52954826[com.mycompany.TrestleLauncher] starting from SystemClassLoader[263 modules]; see http://wiki.netbeans.org/DevFaqModuleCCE
INFO [org.openide.loaders.FolderInstance.Menu.View]
Cannot get class for MultiFileObject#26bf742[Menu/View/org-netbeans-modules-editor-NbCodeFoldingAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Cannot get class for MultiFileObject#26bf742[Menu/View/org-netbeans-modules-editor-NbCodeFoldingAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Caused: java.lang.NullPointerException
at org.openide.util.Exceptions$AnnException.getMessage(Exceptions.java:238)
at org.openide.util.Exceptions$AnnException.toString(Exceptions.java:321)
at java.util.Objects.toString(Objects.java:159)
at java.lang.Throwable.initCause(Throwable.java:457)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:279)
at org.openide.util.Exceptions$AnnException.findOrCreate(Exceptions.java:256)
at org.openide.util.Exceptions.attachMessage(Exceptions.java:85)
at org.openide.loaders.InstanceSupport.findClass(InstanceSupport.java:506)
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:148)
Caused: java.lang.ClassNotFoundException: From file: MultiFileObject#26bf742[Menu/View/org-netbeans-modules-editor-NbCodeFoldingAction.instance] due to
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:162)
at org.openide.loaders.InstanceDataObject$Ser.instanceClass(InstanceDataObject.java:1338)
at org.openide.loaders.InstanceDataObject.instanceClass(InstanceDataObject.java:809)
at org.openide.awt.MenuBar$LazyMenu$MenuFolder.acceptCookie(MenuBar.java:808)
[catch] at org.openide.loaders.FolderInstance.acceptDataObject(FolderInstance.java:419)
at org.openide.loaders.FolderInstance.defaultProcessObjects(FolderInstance.java:795)
at org.openide.loaders.FolderInstance.access$000(FolderInstance.java:103)
at org.openide.loaders.FolderInstance$1R.init(FolderInstance.java:693)
at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:720)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)
ALL [null]: Cannot get class for MultiFileObject#26bf742[Menu/View/org-netbeans-modules-editor-NbCodeFoldingAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
WARNING [org.netbeans.modules.editor.settings.storage.keybindings.KeyMapsStorage]: The keybinding 'A-MOUSE_WHEEL_UP' in Editors/Keybindings/NetBeans/Defaults/org-netbeans-modules-editor-keybindings.xml may not work correctly on Mac. Keybindings starting with Alt or Ctrl should be coded with latin capital letters 'O' or 'D' respectively. For details see org.openide.util.Utilities.stringToKey().
WARNING [org.netbeans.modules.editor.settings.storage.keybindings.KeyMapsStorage]: The keybinding 'A-MOUSE_WHEEL_DOWN' in Editors/Keybindings/NetBeans/Defaults/org-netbeans-modules-editor-keybindings.xml may not work correctly on Mac. Keybindings starting with Alt or Ctrl should be coded with latin capital letters 'O' or 'D' respectively. For details see org.openide.util.Utilities.stringToKey().
WARNING [org.netbeans.ProxyClassLoader]: Will not load class org.netbeans.modules.editor.MainMenuAction$GoToSourceAction arbitrarily from one of ModuleCL#183d64f7[org.netbeans.modules.editor] and ModuleCL#52954826[com.mycompany.TrestleLauncher] starting from SystemClassLoader[263 modules]; see http://wiki.netbeans.org/DevFaqModuleCCE
INFO [org.openide.loaders.FolderInstance.Menu.GoTo]
Cannot get class for MultiFileObject#7e5308ff[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSourceAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Cannot get class for MultiFileObject#7e5308ff[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSourceAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Caused: java.lang.NullPointerException
at org.openide.util.Exceptions$AnnException.getMessage(Exceptions.java:238)
at org.openide.util.Exceptions$AnnException.toString(Exceptions.java:321)
at java.util.Objects.toString(Objects.java:159)
at java.lang.Throwable.initCause(Throwable.java:457)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:279)
at org.openide.util.Exceptions$AnnException.findOrCreate(Exceptions.java:256)
at org.openide.util.Exceptions.attachMessage(Exceptions.java:85)
at org.openide.loaders.InstanceSupport.findClass(InstanceSupport.java:506)
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:148)
Caused: java.lang.ClassNotFoundException: From file: MultiFileObject#7e5308ff[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSourceAction.instance] due to
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:162)
at org.openide.loaders.InstanceDataObject$Ser.instanceClass(InstanceDataObject.java:1338)
at org.openide.loaders.InstanceDataObject.instanceClass(InstanceDataObject.java:809)
at org.openide.awt.MenuBar$LazyMenu$MenuFolder.acceptCookie(MenuBar.java:808)
[catch] at org.openide.loaders.FolderInstance.acceptDataObject(FolderInstance.java:419)
at org.openide.loaders.FolderInstance.defaultProcessObjects(FolderInstance.java:795)
at org.openide.loaders.FolderInstance.access$000(FolderInstance.java:103)
at org.openide.loaders.FolderInstance$1R.init(FolderInstance.java:693)
at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:720)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)
ALL [null]: Cannot get class for MultiFileObject#7e5308ff[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSourceAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
WARNING [org.netbeans.ProxyClassLoader]: Will not load class org.netbeans.modules.editor.MainMenuAction$GoToSuperAction arbitrarily from one of ModuleCL#183d64f7[org.netbeans.modules.editor] and ModuleCL#52954826[com.mycompany.TrestleLauncher] starting from SystemClassLoader[263 modules]; see http://wiki.netbeans.org/DevFaqModuleCCE
INFO [org.openide.loaders.FolderInstance.Menu.GoTo]
Cannot get class for MultiFileObject#210198eb[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSuperAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Cannot get class for MultiFileObject#210198eb[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSuperAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Caused: java.lang.NullPointerException
at org.openide.util.Exceptions$AnnException.getMessage(Exceptions.java:238)
at org.openide.util.Exceptions$AnnException.toString(Exceptions.java:321)
at java.util.Objects.toString(Objects.java:159)
at java.lang.Throwable.initCause(Throwable.java:457)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:279)
at org.openide.util.Exceptions$AnnException.findOrCreate(Exceptions.java:256)
at org.openide.util.Exceptions.attachMessage(Exceptions.java:85)
at org.openide.loaders.InstanceSupport.findClass(InstanceSupport.java:506)
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:148)
Caused: java.lang.ClassNotFoundException: From file: MultiFileObject#210198eb[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSuperAction.instance] due to
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:162)
at org.openide.loaders.InstanceDataObject$Ser.instanceClass(InstanceDataObject.java:1338)
at org.openide.loaders.InstanceDataObject.instanceClass(InstanceDataObject.java:809)
at org.openide.awt.MenuBar$LazyMenu$MenuFolder.acceptCookie(MenuBar.java:808)
[catch] at org.openide.loaders.FolderInstance.acceptDataObject(FolderInstance.java:419)
at org.openide.loaders.FolderInstance.defaultProcessObjects(FolderInstance.java:795)
at org.openide.loaders.FolderInstance.access$000(FolderInstance.java:103)
at org.openide.loaders.FolderInstance$1R.init(FolderInstance.java:693)
at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:720)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)
ALL [null]: Cannot get class for MultiFileObject#210198eb[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSuperAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
WARNING [org.openide.filesystems.Ordering]: Not all children in Menu/Window/ marked with the position attribute: [Other], but some are: [org-netbeans-modules-project-ui-logical-tab-action.shadow, org-netbeans-modules-project-ui-physical-tab-action.shadow, org-netbeans-modules-favorites-View.shadow, org-netbeans-core-ide-ServicesTabAction.shadow, org-netbeans-modules-tasklist-ui-TaskListAction.shadow, ShowPaletteAction.shadow, org-netbeans-core-windows-actions-GlobalPropertiesAction.shadow, Output, Navigator, Debug, Versioning, Web, SwitchToRecentDocumentAction.shadow, ProgressListAction.shadow, Separator3.instance, ConfigureWindow, org-netbeans-core-windows-actions-ResetWindowsAction.shadow, Separator4.instance, CloseWindowAction.shadow, CloseAllDocumentsAction.shadow, CloseAllButThisAction.shadow, DocumentsAction.shadow]
WARNING [org.netbeans.TopSecurityManager]: use of system property netbeans.user has been obsoleted in favor of InstalledFileLocator/Places at org.netbeans.modules.uihandler.Installer.logsDirectory(Installer.java:840)
INFO [org.netbeans.core.netigso.Netigso]: bundle org.eclipse.osgi#3.8.0.v20120529-1548 256
INFO [org.netbeans.core.netigso.Netigso]: bundle org.eclipse.osgi#3.8.0.v20120529-1548 stopped
INFO [org.netbeans.core.netigso.Netigso]: bundle org.eclipse.osgi#3.8.0.v20120529-1548 stopped

This seems to have been a result of adding a library package via Wrapped .JAR that didn't need to be added (or more accurately, needed to be added using a more correct method). Instead of finding, downloading, and depending on Wrapped .JAR files to account for dependencies, I needed to add module dependencies by name (not by package) in NetBeans.

Related

When building a native quarkus image, how should I (re-)structure my code to enable runtime class initialization?

I'm building a native image with quarkus and the graal analysis fails with the error:
Error: No instances of sun.security.provider.NativePRNG are allowed in the image heap as this class should be initialized at image runtime. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked.
Detailed message:
Trace: Object was reached by
reading field java.security.SecureRandom.secureRandomSpi of
constant java.security.SecureRandom#472a6481 reached by
scanning method com.nimbusds.oauth2.sdk.id.Identifier.<init>(Identifier.java:112)
Call path from entry point to com.nimbusds.oauth2.sdk.id.Identifier.<init>(int):
at com.nimbusds.oauth2.sdk.id.Identifier.<init>(Identifier.java:105)
at com.nimbusds.oauth2.sdk.token.Token.<init>(Token.java:62)
at com.nimbusds.oauth2.sdk.token.AccessToken.<init>(AccessToken.java:121)
at com.nimbusds.oauth2.sdk.token.BearerAccessToken.<init>(BearerAccessToken.java:114)
at ff.service.identity.application.OAuthAccessTokenProvider.generateAccessToken(OAuthAccessTokenProvider.java:78)
at ff.service.identity.application.OAuthAccessTokenProvider.completeAccessTokenGeneration(OAuthAccessTokenProvider.java:62)
at ff.service.identity.application.OAuthAccessTokenProvider_ClientProxy.completeAccessTokenGeneration(OAuthAccessTokenProvider_ClientProxy.zig:198)
at ff.service.identity.application.OAuthService.validateSignedChallenge(OAuthService.java:187)
at ff.service.identity.application.OAuthService_Subclass.validateSignedChallenge$$superaccessor1(OAuthService_Subclass.zig:258)
at ff.service.identity.application.OAuthService_Subclass$$function$$1.apply(OAuthService_Subclass$$function$$1.zig:41)
at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:190)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:143)
at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:345)
at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_ARRAY:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)
It correctly and logically states that the class for the random number generator provider should be initialised at runtime. However, unlike in the docs, no call path is given because the:
Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked
I don't know how to go about restructuring my code to support this, and I'm not doing anything really exotic, as far as I can tell. To prepare this question, I brutally moved the code together involving classes from com.nimbusds, and it now resides in OAuthService and OAuthAccessTokenProvider. OAuthService is only used by my OAuthResouce, and even after making these two services #RequestScoped to enforce lazy initialization, the error message remains unchanged.
When I add --initialize-at-run-time=ff.service.identity.application.OAuthService, I actually receive less information about the observed problem.
Error: Classes that should be initialized at run time got initialized during image building:
ff.service.identity.application.OAuthService the class was requested to be initialized at run time (from the command line). ff.service.identity.application.OAuthService has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Try avoiding to initialize the class that caused initialization of ff.service.identity.application.OAuthService
com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building:
ff.service.identity.application.OAuthService the class was requested to be initialized at run time (from the command line). ff.service.identity.application.OAuthService has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Try avoiding to initialize the class that caused initialization of ff.service.identity.application.OAuthService
at com.oracle.svm.core.util.UserError.abort(UserError.java:68)
at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.checkDelayedInitialization(ConfigurableClassInitialization.java:518)
at com.oracle.svm.hosted.classinitialization.ClassInitializationFeature.duringAnalysis(ClassInitializationFeature.java:187)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$8(NativeImageGenerator.java:720)
at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:70)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:720)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:538)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:451)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
I'm supposted to avoid initializing these classes, but I don't know what I'm doing wrong or what other possibilities exist. What have I overseen?
EDIT: I am building with Quarkus 1.6.1.Final, using GraalVM Version 20.1.0 (Java Version 11.0.7).
A solution involving the flag --rerun-class-initialization-at-runtime is actually deprecated since GraalVM 19.0.0 (I can't find a link):
Warning: Using a deprecated option --rerun-class-initialization-at-runtime. Currently there is no replacement for this option. Try using --initialize-at-run-time or use the non-API option -H:ClassInitialization directly.
Most likely you need to use rerun-class-initialization-at-runtime= com.nimbusds.oauth2.sdk.id.Identifier

HotSwapAgent - IncompatibleClassChangeError Type HeaderPanel$1 is not a nest member of HeaderPanel: current type is not listed as a nest member

I have a problem w HotSwap Agent. It is not working correctly.
Setup:
JDK 11 from HotswapAgent.org
Widlfly 14
NetBeans 9
HotSwapAgent 1.3.1-SNAPSHOT
On start i
HOTSWAP AGENT: 08:17:59.098 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {1.3.1-SNAPSHOT} - unlimited runtime class redefinition.
In the middle i get a strange:
08:18:56,713 INFO [stdout] (ServerService Thread Pool -- 77) HOTSWAP AGENT: 08:18:56.713 WARNING (org.hotswap.agent.watch.nio.TreeWatcherNIO) - Unable to watch for path vfs:/C:/Java/wildfly-14.0.0.Final/bin/content/application.war/WEB-INF/classes/com/company/, not a local regular file or directory.
But it goes further ok. I change code, click apply code chages. It seemingly changes the code:
Classes to reload:
com.company.web.HeaderPanel$13
com.company.web.HeaderPanel$2
com.company.web.HeaderPanel$3
com.company.web.HeaderPanel$4
com.company.web.HeaderPanel
com.company.web.HeaderPanel$5
com.company.web.HeaderPanel$10
com.company.web.HeaderPanel$11
com.company.web.HeaderPanel$1
com.company.web.HeaderPanel$12
com.company.web.HeaderPanel$6
com.company.web.HeaderPanel$7
com.company.web.HeaderPanel$8
com.company.web.HeaderPanel$9
Code updated
In runtime it then throws an incompatible class change error when i go to the changed class:
java.lang.IncompatibleClassChangeError: Type com.company.web.HeaderPanel$1 is not a nest member of com.company.web.HeaderPanel: current type is not listed as a nest member
at deployment.application.war//com.company.web.HeaderPanel$1.onConfigure(HeaderPanel.java:110)
The relevant source code line is a overriden function in an anonymous class, the super. call:
#Override
protected void onConfigure() {
super.onConfigure();
setVisible(!ssoService.isEnabled());
}
It is not the line i modified. I modified an completely different line.

Attribute 'JCabi-Version' not found in MANIFEST.MF file(s)

I keep getting this error whenever I try to run the jar file of the project from the command prompt. What does this mean? I checked the manifest for ValidatorBuilder and it has the jcabi-version attribute. Any help is appreciated. Thanks.
2014-12-01 09:42:49 DEBUG ServiceLoaderUtils:138 - Trying to load all SPI implem
entations of interface com.phloc.commons.hash.IHashCodeImplementationRegistrarSP
I
2014-12-01 09:42:49 DEBUG ServiceLoaderUtils:172 - Finished loading all SPI impl
ementations of interface com.phloc.commons.hash.IHashCodeImplementationRegistrar
SPI --> returning 2 instances
2014-12-01 09:42:49 DEBUG HashCodeImplementationRegistry:281 - Found no hashCode
implementation for class java.lang.String
2014-12-01 09:42:49 DEBUG Manifests:168 - 6 attribute(s) loaded ["Archiver-Versi
on", "Build-Jdk", "Built-By", "Created-By", "Main-Class", "Manifest-Version"]
2014-12-01 09:42:49 INFO Manifests:193 - 6 attributes loaded from 1 stream(s) i
n 10ms, 6 saved, 0 ignored: ["Archiver-Version", "Build-Jdk", "Built-By", "Creat
ed-By", "Main-Class", "Manifest-Version"]
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.jcabi.w3c.ValidatorBuilder.<clinit>(ValidatorBuilder.java:71)
at com.cerner.devcenter.wag.processor.CSSValidatorAdapter.cssW3CValidati
on(CSSValidatorAdapter.java:29)
at com.cerner.devcenter.wag.processor.CSSValidator.validateCSS(CSSValida
tor.java:50)
at com.cerner.devcenter.wag.ruleEngine.CSSRuleEngine.<init>(CSSRuleEngin
e.java:64)
at com.cerner.devcenter.wag.processor.CSSAssessment.getGradeReport(CSSAs
sessment.java:134)
at com.cerner.devcenter.wag.textHandler.AssessmentFactory.getGradeReport
(AssessmentFactory.java:98)
at com.cerner.devcenter.wag.WebAssessmentGraderRunner.trackAssessmentFil
es(WebAssessmentGraderRunner.java:138)
at com.cerner.devcenter.wag.WebAssessmentGraderRunner.trackAssessmentFil
es(WebAssessmentGraderRunner.java:135)
at com.cerner.devcenter.wag.WebAssessmentGraderRunner.main(WebAssessment
GraderRunner.java:85)
Caused by: java.lang.IllegalArgumentException: Attribute 'JCabi-Version' not fou
nd in MANIFEST.MF file(s) among 6 other attribute(s): ["Archiver-Version", "Buil
d-Jdk", "Built-By", "Created-By", "Main-Class", "Manifest-Version"]
at com.jcabi.manifests.Manifests.read(Manifests.java:274)
at com.jcabi.w3c.BaseValidator.<clinit>(BaseValidator.java:63)
... 9 more
Looks like you're using an old version of jcabi-w3c. Try the latest one (1.1). If you still have the same issue, submit a ticket here: https://github.com/jcabi/jcabi-w3c/issues We'll try to help

How to put javaScript code in Java program/application?

Trying to put in your application code of Ace Editor: http://ace.c9.io/#nav=embedding.
I found something like this: http://metoojava.wordpress.com/2010/06/20/execute-javascript-from-java/
and I put this code:
engine.eval(new java.io.FileReader("ace-builds/src-noconflict/ace.js"));
But I have build errors.
Exception in thread "main" javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "window" is not defined. (<Unknown source>#1513) in <Unknown source> at line number 1513
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:224)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
at javaapplication9.JavaApplication9.main(JavaApplication9.java:28)
Caused by: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "window" is not defined. (<Unknown source>#1513)
at sun.org.mozilla.javascript.internal.ScriptRuntime.constructError(ScriptRuntime.java:3770)
at sun.org.mozilla.javascript.internal.ScriptRuntime.constructError(ScriptRuntime.java:3748)
at sun.org.mozilla.javascript.internal.ScriptRuntime.notFoundError(ScriptRuntime.java:3833)
at sun.org.mozilla.javascript.internal.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1826)
at sun.org.mozilla.javascript.internal.ScriptRuntime.name(ScriptRuntime.java:1765)
at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Interpreter.java:1785)
at sun.org.mozilla.javascript.internal.Interpreter.interpret(Interpreter.java:849)
at sun.org.mozilla.javascript.internal.InterpretedFunction.call(InterpretedFunction.java:162)
at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(ContextFactory.java:430)
at com.sun.script.javascript.RhinoScriptEngine$1.superDoTopCall(RhinoScriptEngine.java:116)
at com.sun.script.javascript.RhinoScriptEngine$1.doTopCall(RhinoScriptEngine.java:109)
at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(ScriptRuntime.java:3160)
at sun.org.mozilla.javascript.internal.InterpretedFunction.exec(InterpretedFunction.java:173)
at sun.org.mozilla.javascript.internal.Context.evaluateReader(Context.java:1169)
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:214)
... 2 more
Do any of you know how can I do this?
Thans for help and Happy Holidays!
Keep in mind that you are executing a Javascript file out of context.
This Javascript file is usually executed with the browser JS engine so if you are not in that context you could not access to some objects like navigator, window... etc.

YUICompressor crashes - stackoverflow error

I frequently get what appears to be a stackoverflow error ;-) from YUICompressor. The following is the first part of thousands of error lines that come from attempting to compress a 24074 byte css stylesheet (not the "Caused by java.lang.StackOverflowError about 8 lines down):
iMac1:src jas$ min ../style2.min.css style2.css
Exception in thread "main" java.lang.reflect.InvocationTargetException
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.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)
Caused by: java.lang.StackOverflowError
at java.lang.Character.codePointAt(Character.java:2335)
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3344)
at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
... (plus 1021 more error lines)
The errors happen usually after adding a couple of lines to the file getting compressed. The css is fine, and works perfectly in the uncompressed format. I don't see a particular pattern to the types of selectors added to the file that cause the errors. In this case, adding the following selector to a previously compressible file resulted in the errors:
#thisisatest
{
margin-left:87px;
}
I am wondering if there is perhaps a flag to java to enlarge the stack that might help. Or if that is not the problem, what is?
EDIT:
As I was posting this question, it dawned on me that I should check the java command to see if there was a parameter to enlarge the stack. Turns out that it is -Xssn, where "n" is a parameter to indicate the stack size. Its default value is 512k. So I tried 1024k but that still led to the stackoverflow. Trying 2048k works however, and I think this could be the solution.
EDIT 2:
While I no longer use this method for minification any longer, to be more specific here is the full command (which I have set up as a shell alias), showing how the -Xss2048k parameter is used:
java -Xss2048k -jar ~/Documents/RepHunter/Website\ Materials/Code/Third\ Party\ Libraries/YUI\ Compressor/yuicompressor-2.4.8.jar --type css -o
As posted in my edit, the solution was to add the parameters to the java command. The clue was the error line at the 5-th "at" line, as follows:
at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)
Caused by: java.lang.StackOverflowError
Seeing that the issue was a "StackOverlowError" ;-) gave the suggestion to try to increase the stack size. The default is 512k. My first try of 1024k did not work. However increasing it to 2048k did work, and I have had no further issues.

Categories

Resources