B4J Question Can't get .jar version of server to run (runs OK in B4J)

Andris

Active Member
Licensed User
Longtime User
I have a desktop server app that runs perfectly in B4J. However, when I try to run the .jar file (created after compiling in Release mode), I get a Java exception and it crashes.

Running it in B4J, the log does show a warning about a missing resource exception, which I assume (?) is the reason that it crashes as a jar:
B4X:
WARN:oejh.MimeTypes:main: java.util:MissingResourceException: Can't find bundle for base name org/eclipse/jetty/http/encoding, locale en_US

Can anyone tell me what to do at this point? Thanks.
 

Andris

Active Member
Licensed User
Longtime User
Run your app from the command line. Use:
java -jar <your jar file>

Also check the output of java -version.

I will try that but I have to fix my Path variables first ... However, I have a companion B4J app which runs perfectly when I double-click, so the Java installation should be OK.

Let me ask you this - The server app references a MySQL connector, like so:

B4X:
#Region  Project Attributes
    #CommandLineArgs:
    #MergeLibraries: False
    #AdditionalJar: mysql-connector-java-5.1.30-bin
#End Region

Where does mysql-connector-java-5.1.30-bin.jar have to be located in relation to the B4J jar file? Or is it wrapped up into the B4J jar file so that I don't have to worry about that?
 
Upvote 0

Andris

Active Member
Licensed User
Longtime User

Erel, sorry to have wasted your time on this thread . As the B4J server app is compiling, it clearly states that the #AdditionalJar will not be included in the .jar file and that it must be distributed in the lib folder. I have a feeling this will solve my problem. My bad.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…