Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX bundle exe not showing TableView contents

We have created one JavaFX application, which contains many TableView to show data. We have built native bundle using Ant, and we are obfuscating jar with Proguard-4.8 and we are able to create native bundle exe using that obfuscated jar successfully. When we are running exe, it launching the application successfully, All things are working fine, data are present in tableView, but we are not able to see data in TableView. Below the screen shot taken from exe for TableView is attached -

NOTE : We are able to see data in TableView using jar and exe created without obfuscation.

TableView

Step to obfuscate jar in build.xml

<target name="ObfuscatingProject" depends="apidocs">

            <taskdef resource="proguard/ant/task.properties" classpath="${WorkingFolder}/proguard.jar" />
            <proguard>
                -dontusemixedcaseclassnames
                -printmapping Project_Proguard.map
                -dontshrink
                -dontoptimize
                -dontskipnonpubliclibraryclasses
                -dontskipnonpubliclibraryclassmembers

                -libraryjars "${java.home}/lib/rt.jar"
                -libraryjars "${java.home}/lib/javaws.jar"
                -libraryjars "${env.JAVA_HOME}/lib/ant-javafx.jar"
                -libraryjars "${env.JAVA_HOME}/jre/lib/jfxrt.jar"           
                -libraryjars ${WorkingFolder}/libs/BareBonesBrowserLaunch.jar
                -libraryjars ${WorkingFolder}/libs/activation.jar
                -libraryjars ${WorkingFolder}/libs/log4j-1.2.16.jar
                -libraryjars ${WorkingFolder}/libs/commons-codec-1.5.jar
                -libraryjars ${WorkingFolder}/libs/commons-httpclient-3.1.jar
                -libraryjars ${WorkingFolder}/libs/commons-logging-1.1.1.jar
                -libraryjars ${WorkingFolder}/libs/commons-io-2.0.1.jar
                -libraryjars ${WorkingFolder}/libs/xercesImpl-2.9.1.jar
                -libraryjars ${WorkingFolder}/libs/javax.mail.jar
                -libraryjars ${WorkingFolder}/libs/balloontip-1.2.1.jar
                -libraryjars ${WorkingFolder}/libs/httpclient-4.1.1.jar
                -libraryjars ${WorkingFolder}/libs/httpcore-4.1.3.jar
                -libraryjars ${WorkingFolder}/libs/jcifs-1.3.16.jar         
                -libraryjars ${WorkingFolder}/libs/proguard-4.8.jar
                -libraryjars ${WorkingFolder}/libs/xml-apis-1.3.04.jar
                -libraryjars ${WorkingFolder}/libs/swingx-1.6.jar
                -libraryjars ${WorkingFolder}/libs/derby.jar


                -injars ${WorkingFolder}/${app.name}.jar
                -injars ${WorkingFolder}/CustomJars/LicVerifier.jar(!META-INF/MANIFEST.MF)
                -injars ${WorkingFolder}/CustomJars/LicUtility.jar(!META-INF/MANIFEST.MF)


                -outjars ${WorkingFolder}/ObfuscatedProjectJar/ProjectObfuscated.jar

                -ignorewarnings

                -keepattributes 

                Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod
                -adaptresourcefilecontents **.fxml,**.properties,META-INF/MANIFEST.MF,images/*.jar,Project.version

                -keepclassmembernames class * {
                    @javafx.fxml.FXML *;
                } 

                -keepclassmembernames class com.javafx.main.Main {
                    public static void main(java.lang.String[]);
                } 


                -keep class com.javafx.main.*

                -keepclasseswithmembers public class com.javafx.main.Main{
                    public static void main(java.lang.String[]);
                }

                -keepclasseswithmembers public class com.project.main.ProjectEntryFX{
                    public static void main(java.lang.String[]);
                 }

                -keepclasseswithmembers public class net.project.license.LicEntryPoint{
                     public *;
                 }


                -keep class * extends org.xml.sax.helpers.DefaultHandler

                -keepclassmembers class * extends org.xml.sax.helpers.DefaultHandler {
                    private *;
                        public *;
                }

            </proguard>
    </target> 

Can someone suggest me what to be improved to see data in JavaFX TableView?

Thanks for help!!

like image 601
Neelam Sharma Avatar asked Jan 16 '13 10:01

Neelam Sharma


1 Answers

javaFx must access some methods of your classes considering their name.

For example: if you have a class Person whith attribue name, surName,... you probably wrote:

public Class Person {

private StringProperty name, surname,....

public StringProperty nameProperty() {
        return name;
    }

public StringProperty surnameProperty() {
        return surname;
}

...

}

methods like nameProperty, surnNameProperty may be probably accessed in your application by code like this:

new PropertyValueFactory<Person, String>("name")
new PropertyValueFactory<Person, String>("surName")

The obfuscator must not rename such methods (nameProperty, surnameProperty...). You can tell this with a configuration like this:

-keepclassmembers public class yourpackage.** {
    public javafx.beans.property.StringProperty *Property();
}
like image 173
user2910964 Avatar answered Nov 11 '22 11:11

user2910964