Someone with a b4j solution on a productive hosted server?

Discussion in 'Chit Chat' started by KMatle, Feb 4, 2015.

  1. KMatle

    KMatle Expert Licensed User

    Inhouse solutions (intranet) are quite simple to develop. But what about the "real" world? Anyone here with a hosted server using b4j as the main server component? Hod did you do it?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    B4i remote compilers are implemented with B4J (as well as two other B4J server programs that manage the builders).
     
  3. lemonisdead

    lemonisdead Well-Known Member Licensed User

    @KMatle: this is a really good question. In fact, because of my lack of knowledge, I was not able to install a way to start the java files produced by B4J. In fact, I could have been able to install the packages on my Linux VPS with CLI but I wouldn't have been able to execute the apps...
    But this thread gave me the idea to test the solution again

    s1:~/www/b4j$ java -jar WebAppHelloWorld.jar
    main._process_globals (java line: 69)
    java.lang.UnsupportedClassVersionError: anywheresoftware/b4j/object/ServerWrapper : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
    at b4j.example.main._process_globals(main.java:69)
    at b4j.example.main.initializeProcessGlobals(main.java:60)
    at b4j.example.main.main(main.java:27)
     
    Last edited: Feb 5, 2015
    KMatle likes this.
  4. Erel

    Erel Administrator Staff Member Licensed User

    On Linux the simplest way to run a B4J server is with a script that calls:
    nohup java -jar <jar file>

    The error message means that you need to switch to a more recent version of Java JRE.

    Run java -version to test the version. It should be java 7+.
     
    lemonisdead likes this.
  5. lemonisdead

    lemonisdead Well-Known Member Licensed User

    @Erel : I due you a lot of thanks because without your help I wouldn't have found that the OpenJDK was used instead of the Oracle one (I had installed Java via apt-get without the proprietary repositories). Now, with the help of that page, I was able to correct my installation.
    And guess what : the Web App Hello World is running :)
    Many, many thanks for that help because it opens a lot of possibilities
     
  6. KMatle

    KMatle Expert Licensed User

    lemonisdead likes this.
  7. lemonisdead

    lemonisdead Well-Known Member Licensed User

    I can understand my reply was not exciting at all. Today I have updated a Customer's app including a sync function to a B4J server to save the apps preferences. 50 users were updated. The solution is running smoothly
     
    Erel likes this.
  8. Erel

    Erel Administrator Staff Member Licensed User

    [​IMG]

    See these two processes. ServerExample.jar process (which is a complex app with many examples, web socket handlers and regular servlets) is running for 4 months now. The memory usage is constant.
    The second process is running for more than two months.
     
    Last edited: Feb 9, 2015
    lemonisdead and KMatle like this.
  9. KMatle

    KMatle Expert Licensed User

    Cool. @lemonisdead : What kind of server is it (hosted? shared?)
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    VPS. You cannot run B4J servers on shared accounts.
     
  11. lemonisdead

    lemonisdead Well-Known Member Licensed User

    @KMatle : I have installed this first server on a VPS as a test drive. I will publish other projects on a dedicated one (which was not already configured to use the correct Java version at the time I had published).

    @Erel : I do really thank you for the quality of your amazing products. Really
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    Note that you don't really need to install Java. You can copy the files to a folder and then instead of writing java -jar you should write <full path to java>/bin/java -jar.
     
    lemonisdead likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice