Java Web Start issue

39 views
Skip to first unread message

peter....@scholze-it.de

unread,
Jul 23, 2014, 7:30:56 AM7/23/14
to jrebirt...@googlegroups.com
Dear Sebastien,

at first -again- thank you for the good job You did with JRebirth!

My JRebirth-powered application works fine, except in one case: If the application instance is started unsing Java Web Start, there are neither properties nor localized messages - it seems the *.properties files in classpath can't be found anymore ...

Any ideas?

Thanks in advance,
best regards

Peter

Sebastien Bordes

unread,
Jul 23, 2014, 7:55:19 AM7/23/14
to jrebirt...@googlegroups.com
Hello Peter,

Thanks, I'm always happy to discover new application written with JRebirth, it's an opportunity to improve the library. Feedbacks and bug reports are so valuable !

Could you tell me more about your application.

What JRebirth version do you use ?
What version of JRE are you using ?
Does Webstart Console log correctly JRebirth messages ?
Do you have custom properties files ?
If yes, Where do you store them ?

It's probably an issue due to security restrictions, I will create an issue to fix it into 7.7.3 rebound

Thx

Seb


--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "JRebirth Users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-user...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.



--

Peter Scholze

unread,
Jul 23, 2014, 8:01:51 AM7/23/14
to jrebirt...@googlegroups.com
Hello Sebastien,

here my answers to Your questions:
  • JRebirth 7.7.2
  • JRE 1.8.0_05
  • Webstart Console is logging correctly
  • jrebirth.properties and dokubase-jrebirth.properties, both can't be found under Webstart
  • File are stored in classpath root
Maybe its a classloader problem?

Best regards, Peter

Am 23.07.14 13:55, schrieb Sebastien Bordes:
Vous recevez ce message, car vous êtes abonné à un sujet dans le groupe Google Groupes "JRebirth Users".
Pour vous désabonner de ce sujet, visitez le site https://groups.google.com/d/topic/jrebirth-users/rz0kNndoFYQ/unsubscribe.
Pour vous désabonner de ce groupe et de tous ses sujets, envoyez un e-mail à l'adresse jrebirth-user...@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.


-- 
scholze IT Gesellschaft für Informationstechnologie mbH

Softwareentwicklung und IT-Projektunterstützung
Datenschutz und Datensicherheit
Sachverständigenbüro für IT-Forensik

Rathenaustr.17
D-67547 Worms

Telefon +49 6241 20023-40
Telefax +49 6241 20023-49

www.scholze-it.de

Geschäftsführer: Peter Scholze, Cathrin Scholze

Registergericht: Amtsgericht Mainz
Registernummer: HRB 43456

USt-ID: DE278275766

Mitgliedschaften:
Berufsverband der Datenschutzbeauftragten Deutschlands (BvD) e.V.
Deutsche Sachverständigen Gesellschaft mbH (DESAG)
Berufsfachverband für das Sachverständigen- und Gutachterwesen (BSG) e.V.

In Kooperation mit:
KWS-Rechtsanwälte
Rathenaustr. 17
67547 Worms 

Sebastien Bordes

unread,
Jul 23, 2014, 8:18:15 AM7/23/14
to jrebirt...@googlegroups.com
Seb

Sebastien Bordes

unread,
Jul 23, 2014, 3:07:12 PM7/23/14
to jrebirt...@googlegroups.com
The problem is diagnosed but the solution isn't really trivial and need some testing because it could have impact on JRebirth packaging.

The problem is that properties files are searched from classpath and loaded as system File.

It's possible to use jnlp API to inspect cached files (jars) but it implies to add a system dependency to javaws.jar resolved automagically at runtime.

Alternatively I can let visible some methods that allow to load properties files programatically (ParameterBuilder.readPropertiesFile and MessagesBuilder.readPropertiesFile ), but I need to debug with the JNPClassLoader.... and my Eclipse is really instable.

Are you blocked by this issue or can you live with it a couple of week ?

Seb
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-users+unsubscribe@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.
--
Vous recevez ce message, car vous êtes abonné à un sujet dans le groupe Google Groupes "JRebirth Users".
Pour vous désabonner de ce sujet, visitez le site https://groups.google.com/d/topic/jrebirth-users/rz0kNndoFYQ/unsubscribe.
Pour vous désabonner de ce groupe et de tous ses sujets, envoyez un e-mail à l'adresse jrebirth-users+unsubscribe@googlegroups.com.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-users+unsubscribe@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Peter Scholze

unread,
Jul 24, 2014, 2:05:54 AM7/24/14
to jrebirt...@googlegroups.com
Hi Sebastien,

unfortunately we'll start our pilot operation phase next monday, heaven knows why this issue could be overlooked by us until now ...
On the other hand, there will only about 10 key users participate in this phase, so installing client releases manually will be a suitable workaround for the next 2 months.

Last night we testet getdown as an alternative to JWS, but ran into the same problem. By the way, Rachel seems to be a promising approach ...

Sincere thanks for Your kind support, Peter


Am 23.07.14 um 21:07 schrieb Sebastien Bordes:
Pour vous désabonner de ce groupe et de tous ses sujets, envoyez un e-mail à l'adresse jrebirth-user...@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Sebastien Bordes

unread,
Jul 24, 2014, 3:15:20 AM7/24/14
to jrebirt...@googlegroups.com
Peter,

I don't think we will have to throw away JWS and I don't know if Rachel can search from JWS "classpath" but a working solution is foreseen.

Unfortunately I will not be able to release a secure 7.7.3 before Monday but before 2 month for sure :)

However I will propose you tonight a workaround (little bit ugly with reflection) that could fix temporary your problem.
I will apply this fix to MasteringTables demo application.

Seb


Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse jrebirth-user...@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.



--

Sebastien Bordes

unread,
Jul 24, 2014, 3:52:44 AM7/24/14
to jrebirt...@googlegroups.com
You can try this workaround:

Add this into Application

    /**
     * {@inheritDoc}
     */
    @Override
    public List<Wave> getPreBootWaveList() {
        return Collections.singletonList(
                WaveBuilder.create()
                .waveGroup(WaveGroup.CALL_COMMAND)
                .relatedClass(LoadPropertiesCommand.class)
                .build());
    }

Add this command

public class LoadPropertiesCommand extends DefaultCommand {

    /**
     * {@inheritDoc}
     */
    @Override
    protected void perform(Wave wave) throws CommandException {

        ParameterBuilder paramBuilder = ResourceBuilders.PARAMETER_BUILDER;
       
        try {
            Method m = ParameterBuilder.class.getMethod("readPropertiesFile", String.class);
           
            m.invoke(paramBuilder, "jrebirth.properties");// enter the relative file path that could be digested by new File
           
        } catch (NoSuchMethodException|SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
            e.printStackTrace();
        }
       
        MessageBuilder messageBuilder = ResourceBuilders.MESSAGE_BUILDER;
       
        try {
            Method m = MessageBuilder.class.getMethod("readPropertiesFile", String.class);
           
            m.invoke(messageBuilder, "Messages_rb.properties");// enter the relative file path that could be digested by new File (copy file where they can be accessed (same jar))
           
        } catch (NoSuchMethodException|SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
            e.printStackTrace();
        }
       
       
    }

}

I cannot test it before tonight
 but the big deal will be to know how get a local file path string readable (try to your properties aside your command class).

Otherwise we will need to directly inject resource bundle into the array list by reflection, a bit harder but possible.

Seb

Sebastien Bordes

unread,
Jul 24, 2014, 4:49:31 AM7/24/14
to jrebirt...@googlegroups.com
It's far better to use: m.invoke(paramBuilder, Thread.currentThread().getContextClassLoader().getResource("jrebirth.properties").getFile());

Sebastien Bordes

unread,
Jul 24, 2014, 8:23:08 AM7/24/14
to jrebirt...@googlegroups.com
I forget another thing so obvious : m.setAccessible(true);

Peter Scholze

unread,
Jul 24, 2014, 11:55:15 AM7/24/14
to jrebirt...@googlegroups.com
Last, but not least - using "getDeclaredMethod" instead of "getMethod" ;-)

Unfortunately your workaround doesn't work for us. And, to top it off, classpath resolution of parameter files also seems to fail when starting the application from local jar! It works only when starting from Netbeans with classpath targeted to <builddir>/classes ...

I took the liberty of changing ParameterBuilder and ClasspathUtility, using ronmamo's awesome reflections-library for classpath scanning.
Now the problem seems to be solved starting the application from local jar as well as under JWS :-)

Details about my changes can be gleaned from attached patch files. It would give me pleasure if you will find my solution helpful.

Best regards
Peter
 

Am 24.07.14 um 14:23 schrieb Sebastien Bordes:
--
ParameterBuilder.patch
ClasspathUtility.patch

Sebastien Bordes

unread,
Jul 24, 2014, 12:14:34 PM7/24/14
to jrebirt...@googlegroups.com
I'm pleased to see that you have found a solution for your release.

You should do the same trick to MessageBuilder for localized message

I have already seen this library but ath this time I was thinkink that I could achieve the same goals with less bytes (I want to add the less dependencies as possible into JRebirth core).
So I will review my code and see if it could be rewritten into JRebirth or if we have to include this interesting library with a really permissive licence !
I will probably merge the 2 scan into one provided to parameter and message builder.

I will be away from my computer next week, but then I will work on this topic to include it into a stable 7.7.3


Seb
 

Sebastien Bordes

unread,
Aug 6, 2014, 7:15:32 AM8/6/14
to jrebirt...@googlegroups.com
Peter,

I have fixed the problem without adding the reflections library: https://github.com/JRebirth/JRebirth/issues/128
I have used the first part of the patch you proposed, thank you

You can find a working example here: http://apps.jrebirth.org/analyzer/7.7.3-SNAPSHOT/JRebirthAnalyzer.jnlp
Launch it with Java Console opened to see related logs.

Let me know if it works with your application properties file.

Seb


Maximilien Wiktorowski

unread,
Sep 19, 2014, 5:02:41 PM9/19/14
to jrebirt...@googlegroups.com
Hi,

I have the same problem when i try to launch it from eclipse -> Run as -> Java application.

Best regards,

Sebastien Bordes

unread,
Sep 20, 2014, 2:51:13 AM9/20/14
to jrebirt...@googlegroups.com
Could you copy paste your error stacktrace (if any) or log message not translated, I will double check this bug this WE

Seb

Sebastien Bordes

unread,
Sep 20, 2014, 4:06:36 AM9/20/14
to jrebirt...@googlegroups.com
A build is running on our continous integration server, it will fix your trouble and unit test that were in failure.

The application MasteringTables was also fixed into its new 7.x branch to use latest 7.7.3 with all bug fixes

I'm about to publish the 7.7.3 artifacts on Maven Central

Seb

Maximilien Wiktorowski

unread,
Sep 20, 2014, 9:30:27 AM9/20/14
to jrebirt...@googlegroups.com
Thanks for the fix, the run as Java Application works now on eclipse.

PS : the keystore property is missing <keystore>${keystore}</keystore> in sample pom

Sebastien Bordes

unread,
Sep 20, 2014, 10:42:49 AM9/20/14
to jrebirt...@googlegroups.com
You should provide your own with your L3 certificate or self-signed certifcate

JRebirth does the trick into its maven settings.xml by using a profile

<settings>
<profiles>
       
        <profile>
            <id>Dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <properties>
                <keystore>C:\JREBIRTH\TOOLS\JRebirth2014.jks</keystore>
                <storetype>JKS</storetype>
                <storepass>****************</storepass>
                <keyalias>JRebirth</keyalias>
                <keypass>******************</keypass>
                <deletekeystore>false</deletekeystore>
                <genkeystore>false</genkeystore>
                <!-- -for artifact signing -->
                <gpg.passphrase>***************</gpg.passphrase>
            </properties>
        </profile>      
    </profiles>

  </settings>

Sebastien Bordes

unread,
Sep 22, 2014, 7:28:52 AM9/22/14
to jrebirt...@googlegroups.com
To close this thread JRebirth Application Framework 7.7.3 is available on Maven Central :

http://search.maven.org/#search|ga|1|g%3A%22org.jrebirth.af%22

Seb
Reply all
Reply to author
Forward
0 new messages