Roberto P. Well-Known Member Licensed User Longtime User Feb 19, 2014 #1 I am trying your example of ServerDataCollection of B4J. In local pc works properly and exchange files with the app developed with B4A. The server does not work, because for one exception that I can not figure out the cause: can you help me? I do not understand the AddHandler method of the server object and what it does? can you explain me? thanks Attachments Immagine.png 35.8 KB · Views: 522
I am trying your example of ServerDataCollection of B4J. In local pc works properly and exchange files with the app developed with B4A. The server does not work, because for one exception that I can not figure out the cause: can you help me? I do not understand the AddHandler method of the server object and what it does? can you explain me? thanks
Erel B4X founder Staff member Licensed User Longtime User Feb 19, 2014 #2 Open the command console (cmd.exe) and go to the app folder. Run java -jar DataCollectionServer.jar It will show you more information about the error. The problem is probably with the Java version. It should be Java 7+. AddHandler is explained here: [Server] Building web servers with B4J Upvote 0
Open the command console (cmd.exe) and go to the app folder. Run java -jar DataCollectionServer.jar It will show you more information about the error. The problem is probably with the Java version. It should be Java 7+. AddHandler is explained here: [Server] Building web servers with B4J
Roberto P. Well-Known Member Licensed User Longtime User Feb 19, 2014 #3 questo è l'errore?! Microsoft Windows [Versione 6.1.7601] Copyright (c) 2009 Microsoft Corporation. Tutti i diritti riservati. C:\Users\SIT.SITSRL\Desktop\serverweb esempio\server db>Run java -jar DataCollec tionServer.jar "Run" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch. C:\Users\SIT.SITSRL\Desktop\serverweb esempio\server db>java -jar DataCollection Server.jar Exception in thread "main" java.lang.NoClassDefFoundError: anywheresoftware/b4a/ BA Caused by: java.lang.ClassNotFoundException: anywheresoftware.b4a.BA at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) Could not find the main class: b4j.example.main. Program will exit. Upvote 0
questo è l'errore?! Microsoft Windows [Versione 6.1.7601] Copyright (c) 2009 Microsoft Corporation. Tutti i diritti riservati. C:\Users\SIT.SITSRL\Desktop\serverweb esempio\server db>Run java -jar DataCollec tionServer.jar "Run" non è riconosciuto come comando interno o esterno, un programma eseguibile o un file batch. C:\Users\SIT.SITSRL\Desktop\serverweb esempio\server db>java -jar DataCollection Server.jar Exception in thread "main" java.lang.NoClassDefFoundError: anywheresoftware/b4a/ BA Caused by: java.lang.ClassNotFoundException: anywheresoftware.b4a.BA at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) Could not find the main class: b4j.example.main. Program will exit.
Erel B4X founder Staff member Licensed User Longtime User Feb 19, 2014 #4 #MergeLibraries is set to False. See the compilation message: You should either distribute the jars together with the main jar or change MergeLibraries to True. Upvote 0
#MergeLibraries is set to False. See the compilation message: You should either distribute the jars together with the main jar or change MergeLibraries to True.
Roberto P. Well-Known Member Licensed User Longtime User Feb 19, 2014 #5 it's ok now! thansk you. Upvote 0