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

birthData is not accepting the arguments #4

Open
JhaSneha opened this issue Jul 19, 2018 · 9 comments
Open

birthData is not accepting the arguments #4

JhaSneha opened this issue Jul 19, 2018 · 9 comments

Comments

@JhaSneha
Copy link

JhaSneha commented Jul 19, 2018

It will be a great help if you can help me with the below error:

Exception in thread "main" java.lang.NoClassDefFoundError: swisseph/SweDate
at app.astrosoft.beans.BirthData.(BirthData.java:62)
at app.astrosoft.beans.BirthData.(BirthData.java:76)
at app.astrosoft.beans.BirthData.(BirthData.java:80)
at com.example.gradle.GradleExternalJar.TestG.sample(GradleExternalJarApplication.kt:66)
at com.example.gradle.GradleExternalJar.GradleExternalJarApplicationKt.main(GradleExternalJarApplication.kt:17)
Caused by: java.lang.ClassNotFoundException: swisseph.SweDate
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

my code is :
val place = Place("Bangalore","Karnataka","India", 25.51, 85.47, 5.30)
val calendar:Calendar=GregorianCalendar(1995, 5, 18, 5, 12, 1)
val birthData = BirthData("Ashwini",calendar,place)

        println("$place ")
        println("$calendar")
        println("$birthData")
@erajasekar
Copy link
Owner

Which language are you coding and what build system you use? Make sure https://github.com/erajasekar/Astrosoft/blob/master/lib/swisseph.jar is in the classpath.

@JhaSneha
Copy link
Author

I am using Kotlin and Gradle ...

@erajasekar
Copy link
Owner

Since swisseph (also few other jars in libs dir) is not available in maven central. you will need to locally install that jar as dependency in gradle.

See
https://medium.com/@petehouston/compile-local-jar-files-with-gradle-a078e5c7a520
https://stackoverflow.com/questions/20700053/how-to-add-local-jar-file-dependency-to-build-gradle-file

Hope that helps.

Raja.

@JhaSneha
Copy link
Author

JhaSneha commented Jul 20, 2018

I want to use the calculateAll( ) under the horoscope.java class ,this time I have added all jars locally that were there under AstroSoft lib , below is the error that i am facing :

2018-07-20 16:46:15.526 ERROR 9358 --- [ main] app.astrosoft.pref.AstrosoftPref : Exception in flusing preferences
java.util.prefs.BackingStoreException: /etc/.java/.systemPrefs/app/astrosoft/pref create failed.
at java.util.prefs.FileSystemPreferences$7.run(FileSystemPreferences.java:619) ~[na:1.8.0_181]
at java.util.prefs.FileSystemPreferences$7.run(FileSystemPreferences.java:615) ~[na:1.8.0_181]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_181]
at java.util.prefs.FileSystemPreferences.writeBackCache(FileSystemPreferences.java:614) ~[na:1.8.0_181]
at java.util.prefs.FileSystemPreferences.syncSpiPrivileged(FileSystemPreferences.java:801) ~[na:1.8.0_181]
at java.util.prefs.FileSystemPreferences.access$2300(FileSystemPreferences.java:50) ~[na:1.8.0_181]
at java.util.prefs.FileSystemPreferences$12.run(FileSystemPreferences.java:771) ~[na:1.8.0_181]
at java.util.prefs.FileSystemPreferences$12.run(FileSystemPreferences.java:769) ~[na:1.8.0_181]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_181]
at java.util.prefs.FileSystemPreferences.syncSpi(FileSystemPreferences.java:768) ~[na:1.8.0_181]
at java.util.prefs.AbstractPreferences.sync2(AbstractPreferences.java:1338) ~[na:1.8.0_181]
at java.util.prefs.AbstractPreferences.sync(AbstractPreferences.java:1329) ~[na:1.8.0_181]
at java.util.prefs.FileSystemPreferences.sync(FileSystemPreferences.java:747) ~[na:1.8.0_181]

@erajasekar
Copy link
Owner

erajasekar commented Jul 20, 2018 via email

@JhaSneha
Copy link
Author

@JhaSneha
Copy link
Author

JhaSneha commented Jul 20, 2018

I have shared my github repo link where my code is added above.
This how I am trying to invoke your function (calculateAll) from Horoscope.java, the error I am facing is mentioned above, currently I am using Linux Os .
It will be a great help if u can visit to my code once and help me out with the issue.
Thank you

@erajasekar
Copy link
Owner

When you launch your app, set the jvm argument -Djava.util.prefs.PreferencesFactory=app.astrosoft.pref.UserPreferencesFactory. For e.g refer to RunAstroSoft.sh

@JhaSneha
Copy link
Author

I have added the jvm argument as you suggested above, still i am facing the issue.
Is there anything else that i need to set manually ?
Below are the errors
018-07-25 15:30:15.730 ERROR 22167 --- [ main] app.astrosoft.pref.AstrosoftPref : Exception in flusing preferences

java.util.prefs.BackingStoreException: Synchronization failed for node '/app/astrosoft/pref/'
at java.util.prefs.MacOSXPreferences.flush(MacOSXPreferences.java:230) ~[na:1.8.0_161]
at app.astrosoft.pref.AstrosoftPref.flush(Unknown Source) [AstroSoft.jar!/:na]
at app.astrosoft.pref.AstrosoftPref.setAstrosoftFilesDir(Unknown Source) [AstroSoft.jar!/:na]
at app.astrosoft.pref.AstrosoftPref.setDefaults(Unknown Source) [AstroSoft.jar!/:na]
at app.astrosoft.pref.AstrosoftPref.(Unknown Source) [AstroSoft.jar!/:na]
at app.astrosoft.ui.AstroSoft.(Unknown Source) [AstroSoft.jar!/:na]
at app.astrosoft.util.SwissHelper.(Unknown Source) [AstroSoft.jar!/:na]
at app.astrosoft.util.SwissHelper.(Unknown Source) [AstroSoft.jar!/:na]
at app.astrosoft.core.Horoscope.(Unknown Source) [AstroSoft.jar!/:na]
at com.example.gradle.GradleExternalJar.TestG.sample(GradleExternalJarApplication.kt:31) [classes!/:na]
at com.example.gradle.GradleExternalJar.GradleExternalJarApplicationKt.main(GradleExternalJarApplication.kt:18) [classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [GradleExternalJar-0.0.1-SNAPSHOT.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [GradleExternalJar-0.0.1-SNAPSHOT.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [GradleExternalJar-0.0.1-SNAPSHOT.jar:na]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [GradleExternalJar-0.0.1-SNAPSHOT.jar:na]

Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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.ExceptionInInitializerError
at app.astrosoft.util.SwissHelper.(Unknown Source)
at app.astrosoft.util.SwissHelper.(Unknown Source)
at app.astrosoft.core.Horoscope.(Unknown Source)
at com.example.gradle.GradleExternalJar.TestG.sample(GradleExternalJarApplication.kt:31)
at com.example.gradle.GradleExternalJar.GradleExternalJarApplicationKt.main(GradleExternalJarApplication.kt:18)
... 8 more
Caused by: java.awt.HeadlessException
at sun.awt.HeadlessToolkit.getScreenSize(HeadlessToolkit.java:284)
at app.astrosoft.ui.AstroSoft.getScreenSize(Unknown Source)
at app.astrosoft.ui.AstroSoft.(Unknown Source)
... 13 more

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

2 participants