0

I have deployed a java hello world "inside a browser" on http://www.applesweet.net/home.htm just to show that things are working fine. You can try it by just typing the url. The package is built using Netbeans.

Therefore, I try to deploy something more complicated using the same method. It's actually a client application I developed with JSE(1.8) + JavaFX8 + Persistence(Eclipse lib). You can try it with this link http://www.applesweet.net/dist/ProjCostTracking.html. It gives me the following error in the Java console.

java.security.AccessControlException: access denied ("java.util.PropertyPermission" "eclipselink.persistencexml" "read") at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at sun.plugin2.applet.FXAppletSecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPropertyAccess(Unknown Source) at java.lang.System.getProperty(Unknown Source) at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.findPersistenceArchives(PersistenceUnitProcessor.java:275) at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.findPersistenceUnitInfoInArchives(JPAInitializer.java:150) at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.findPersistenceUnitInfo(JPAInitializer.java:135) at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:177) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) at ProjCostTracking.KYdb.getEntityManagerFactory(KYdb.java:69) at ProjCostTracking.KYdb.(KYdb.java:31) at ProjCostTracking.Main.start(Main.java:161) at com.sun.javafx.applet.FXApplet2$2.run(Unknown Source) at com.sun.javafx.application.PlatformImpl$6$1.run(Unknown Source) at com.sun.javafx.application.PlatformImpl$6$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl$6.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.access$300(Unknown Source) at com.sun.glass.ui.win.WinApplication$4$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

The code is here: enter image description here

I have tried to hard coded the username, password, ip address and port. The application runs fine as a standalone application.

I am aware of the file persistence.xml must be accessible. I am aware that the persistence.xml is already inside the JAR file. However, I sort of put it everywhere I can; under WEB-INF or along side with the JAR file and even inside LIB folder just in case.

enter image description here

The following snapshot shows how my files are deployed on the Godaddy web hosting service.

FTP Path

It's more like likely related to JPA...but I just can't figure it out. It is working fine as a standalone application.

Any suggestion is welcomed, thanks for the guidance. :)

Dean Chiu
  • 1,325
  • 1
  • 13
  • 13
  • I would imagine that that the default permissions of a JVM hosted within a browser would be much more restrictive than a JVM hosted in the OS itself? If this is an applet, would signing the applet provide it more permissions? http://stackoverflow.com/questions/14650010/how-to-solve-java-security-accesscontrolexception – EdH May 15 '14 at 02:21
  • 1
    What EdH said might be true, also I am a little rusty on JPA, but I don't think the browser/applet allows direct communication to a database. Probably need a webservice somewhere in between. – Joey Roosing May 20 '14 at 18:41

0 Answers0