Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassNotFoundException when starting appbundler-based apps #45

Open
joewiz opened this issue Jun 1, 2019 · 5 comments
Open

ClassNotFoundException when starting appbundler-based apps #45

joewiz opened this issue Jun 1, 2019 · 5 comments

Comments

@joewiz
Copy link
Contributor

joewiz commented Jun 1, 2019

After replacing an old build of appbundler used by eXist-db with a new build of appbundler from this repository's master branch, eXist now fails to start via its appbundler-based app. The console reports a ClassNotFoundException. The full console output is below.

Steps to reproduce:

  1. git clone https://github.com/eXist-db/exist.git
  2. cd exist
  3. git checkout develop-4.x.x
  4. ./build.sh app
  5. dist/eXist-db.app/Contents/MacOS/eXist-JavaAppLauncher

Both appbundler and eXist were built with Oracle JDK 8.

This error did not affect builds of appbundler using my PR 55 from the previous bitbucket repository, and in fact, if you reset HEAD to f5603fb, run ant clean package and copy the resulting jar into eXist and rebuild eXist's app, eXist starts up completely normally without this ClassNotFoundException error. This suggests that some change in f5603fb...master has introduced a regression.

Please let me know if I can provide any other information or further explanation.

$ /Users/joe/workspace/exist/dist/eXist-db.app/Contents/MacOS/eXist-JavaAppLauncher 




Loading Application 'eXist-db'
Working Directory: '/Users/joe'
Searching for a JRE.
Searching for a Java 8
Found a Java 1.8.0_211 JRE
Looks like major version 8
JRE version qualifies
Java Runtime Dylib Path: '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib'
Launchpath: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib
Main Bundle Path: '/Users/joe/workspace/exist/dist/eXist-db.app'
Main Class Name: 'org.exist.start.Main'
Option: -Dexist.home=/Users/joe/workspace/exist/dist/eXist-db.app/Contents/Resources/eXist-db
Option: -Xdock:name=eXist-db
Command line passed to application:
Arg 0: '/Users/joe/workspace/exist/dist/eXist-db.app/Contents/MacOS/eXist-JavaAppLauncher'
Arg 1: '-Djava.library.path=/Users/joe/workspace/exist/dist/eXist-db.app/Contents/MacOS'
Arg 2: '-Djava.class.path=/Users/joe/workspace/exist/dist/eXist-db.app/Contents/Java/Classes:/Users/joe/workspace/exist/dist/eXist-db.app/Contents/Java/start.jar'
Arg 3: '-DLibraryDirectory=/Users/joe/Library'
Arg 4: '-DDocumentsDirectory=/Users/joe/Documents'
Arg 5: '-DApplicationSupportDirectory=/Users/joe/Library/Application Support'
Arg 6: '-DCachesDirectory=/Users/joe/Library/Caches'
Arg 7: '-DApplicationDirectory=/Users/joe/Applications'
Arg 8: '-DAutosavedInformationDirectory=/Users/joe/Library/Autosave Information'
Arg 9: '-DDesktopDirectory=/Users/joe/Desktop'
Arg 10: '-DDownloadsDirectory=/Users/joe/Downloads'
Arg 11: '-DMoviesDirectory=/Users/joe/Movies'
Arg 12: '-DMusicDirectory=/Users/joe/Music'
Arg 13: '-DPicturesDirectory=/Users/joe/Pictures'
Arg 14: '-DSharedPublicDirectory=/Users/joe/Public'
Arg 15: '-DSystemLibraryDirectory=/Library'
Arg 16: '-DSystemApplicationSupportDirectory=/Library/Application Support'
Arg 17: '-DSystemCachesDirectory=/Library/Caches'
Arg 18: '-DSystemApplicationDirectory=/Applications'
Arg 19: '-DSystemUserDirectory=/Users'
Arg 20: '-DUserHome=/Users/joe'
Arg 21: '-DSandboxEnabled=true'
Arg 22: '-DDarkMode=false'
Arg 23: '-DLaunchModifierFlags=0'
Arg 24: '-DLaunchModifierFlagCapsLock=false'
Arg 25: '-DLaunchModifierFlagShift=false'
Arg 26: '-DLaunchModifierFlagControl=false'
Arg 27: '-DLaunchModifierFlagOption=false'
Arg 28: '-DLaunchModifierFlagCommand=false'
Arg 29: '-DLaunchModifierFlagNumericPad=false'
Arg 30: '-DLaunchModifierFlagHelp=false'
Arg 31: '-DLaunchModifierFlagFunction=false'
Arg 32: '-Dexist.home=/Users/joe/workspace/exist/dist/eXist-db.app/Contents/Resources/eXist-db'
Arg 33: '-Xdock:name=eXist-db'
Arg 34: 'org.exist.start.Main'
Arg 35: '-Djava.library.path=/Users/joe/workspace/exist/dist/eXist-db.app/Contents/MacOS'
Arg 36: '-Djava.class.path=/Users/joe/workspace/exist/dist/eXist-db.app/Contents/Java/Classes:/Users/joe/workspace/exist/dist/eXist-db.app/Contents/Java/start.jar'
Arg 37: '-DLibraryDirectory=/Users/joe/Library'
Arg 38: '-DDocumentsDirectory=/Users/joe/Documents'
Arg 39: '-DApplicationSupportDirectory=/Users/joe/Library/Application Support'
Arg 40: '-DCachesDirectory=/Users/joe/Library/Caches'
Arg 41: '-DApplicationDirectory=/Users/joe/Applications'
Arg 42: '-DAutosavedInformationDirectory=/Users/joe/Library/Autosave Information'
Arg 43: '-DDesktopDirectory=/Users/joe/Desktop'
Arg 44: '-DDownloadsDirectory=/Users/joe/Downloads'
Arg 45: '-DMoviesDirectory=/Users/joe/Movies'
Arg 46: '-DMusicDirectory=/Users/joe/Music'
Arg 47: '-DPicturesDirectory=/Users/joe/Pictures'
Arg 48: '-DSharedPublicDirectory=/Users/joe/Public'
Arg 49: '-DSystemLibraryDirectory=/Library'
Arg 50: '-DSystemApplicationSupportDirectory=/Library/Application Support'
Arg 51: '-DSystemCachesDirectory=/Library/Caches'
Arg 52: '-DSystemApplicationDirectory=/Applications'
Arg 53: '-DSystemUserDirectory=/Users'
Arg 54: '-DUserHome=/Users/joe'
Arg 55: '-DSandboxEnabled=true'
Arg 56: '-DDarkMode=false'
Arg 57: '-DLaunchModifierFlags=0'
Arg 58: '-DLaunchModifierFlagCapsLock=false'
Arg 59: '-DLaunchModifierFlagShift=false'
Arg 60: '-DLaunchModifierFlagControl=false'
Arg 61: '-DLaunchModifierFlagOption=false'
Arg 62: '-DLaunchModifierFlagCommand=false'
Arg 63: '-DLaunchModifierFlagNumericPad=false'
Arg 64: '-DLaunchModifierFlagHelp=false'
Arg 65: '-DLaunchModifierFlagFunction=false'
Arg 66: '-Dexist.home=/Users/joe/workspace/exist/dist/eXist-db.app/Contents/Resources/eXist-db'
Arg 67: '-Xdock:name=eXist-db'
Arg 68: 'org.exist.start.Main'
java.lang.ClassNotFoundException: -Djava.library.path=/Users/joe/workspace/exist/dist/eXist-db.app/Contents/MacOS
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.exist.start.Main.invokeMain(Main.java:131)
	at org.exist.start.Main.run(Main.java:453)
	at org.exist.start.Main.main(Main.java:64)
@dizzzz
Copy link

dizzzz commented Jun 2, 2019

image

indeed the order of the parameters is not OK ; args 33/34 are redundant and should be removed

@dizzzz
Copy link

dizzzz commented Jun 2, 2019

actually params 35-68 should not be there. these are double

@joewiz
Copy link
Contributor Author

joewiz commented Jun 2, 2019

@dizzzz Strange indeed. Do you think the duplicate parameters could be the cause of the ClassNotFoundException?

@dizzzz
Copy link

dizzzz commented Jun 2, 2019

yes, I am sure about that

@rschmunk
Copy link
Contributor

rschmunk commented Jun 2, 2019

The doubled params are caused by the changes in the "Remove unnecessary global static state" commit, dd16fd6 on Bitbucket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants