Page 1 of 1

self signed docx4j jars not working

PostPosted: Fri Jan 25, 2013 5:27 am
by sarad
Hi,
I have standalone Javafx application using docx4j 2.8.0.
In a normal application execution (not as an administator) docx4j related stuff doesn't work when I use the self signed docx4j and its dependent jars ,though it doesn't give any exception either. I am using netbeans for self signing of the jars.

However, when I run the application as administrator then everything related with docx4j just works fine.
A lot of my target users may not have the administrator privilage in their win7 box so I have to make it work for them as well.

Also we don't have any keystore for now. So , I have to make it work with self signed generated key.

I hope this is just jar security issue. How can I fix this.

Thanks

Re: self signed docx4j jars not working

PostPosted: Wed Jan 30, 2013 8:39 pm
by jason
Yes, sounds like somewhere in your app there is a permissions issue. Can you run it in a debugger?

docx4all uses JavaFX (1.0) and signed jar files. For what it is worth, its build.xml contains:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  <!-- The Ant Web Start task
 
           You may need to invoke ant with something like:
           
               ANT_OPTS="-Xmx512m -XX:MaxPermSize=256m" ant webstart       
 
      Replace the servlet jar it generates with our new one from Java 6
      (which handles if-modifies-since properly)
     
     
 -->
    <typedef resource="org/unintelligible/antjnlpwar/antjnlpwar.xml" format="xml" uri="org.unintelligible.antjnlpwar"/>
    <target name="webstart"  depends="clean, build-project" >
               
                <property name="lib" value="./build/lib"/>
               
        <mkdir dir="${lib}"/>
                                               
                <!-- copy all the jar files! -->
                <copy todir="${lib}" flatten="true">
                        <!-- requires Ant 1.7.0 -->
                        <path>
                            <path refid="docx4all.classpath"/>
                        </path>
                </copy>        
               
                <jar destfile="docx4all.jar" basedir="build/classes" index="true">
                        <indexjars>
                                <fileset dir="${lib}" />
                        </indexjars>
                        <!--  workaround for the fact that indexjars doesn't index
                              META-INF, with the result that class loader can't
                              find eg vfs-providers.xml.
                              See ant bugzilla bug 47457
                             
                              JAR is happy to have 2 entries with the same name;
                              Unpack will fail though.
                             
                              -->
                        <zipfileset src="${lib}/webdavclient4j-vfs-0.9.3.jar"
                                excludes="META-INF/MANIFEST.MF META-INF/ALIAS.* META-INF/*.txt META-INF/*.SERIALIZER META-INF/LICENSE META-INF/NOTICE"
                                includes="META-INF/**"/>
                        <!--  services/javax.script.ScriptEngineFactory -->
                        <zipfileset src="${lib}/javafxrt-1.0.jar"
                                excludes="META-INF/MANIFEST.MF META-INF/ALIAS.* META-INF/*.txt META-INF/*.SERIALIZER META-INF/LICENSE META-INF/NOTICE"
                                includes="META-INF/**"/>
                        <!--  services/com.sun.tools.xjc.Plugin -->
                        <zipfileset src="${lib}/parent-pointer-plugin-1.0.jar"
                                excludes="META-INF/MANIFEST.MF META-INF/ALIAS.* META-INF/*.txt META-INF/*.SERIALIZER META-INF/LICENSE META-INF/NOTICE"
                                includes="META-INF/**"/>
                        <!--  services/blagh blagh -->
                        <zipfileset src="${lib}/xmlgraphics-commons-1.3.757686.jar"
                                excludes="META-INF/MANIFEST.MF META-INF/ALIAS.* META-INF/*.txt META-INF/*.SERIALIZER META-INF/LICENSE META-INF/NOTICE"
                                includes="META-INF/**"/>
                        <zipfileset src="${lib}/fop-patched-0.95.756437.jar"
                                excludes="META-INF/MANIFEST.MF META-INF/ALIAS.* META-INF/*.txt META-INF/*.SERIALIZER META-INF/LICENSE META-INF/NOTICE
                                META-INF/services/org.apache.xmlgraphics.*"

                                includes="META-INF/**"/> <!--  2 copies of xmlgraphics causes unpack task to fail -->
                </jar>
                        <!-- somewhere other than ${lib}, docx4all does not need to be in
                             the above; it is handled by jw:application below.  -->
               
                                       
        <!-- Create a distributable WAR archive of the application using the following attributes:
        * tofile: the destination WAR file
        * codebase: where the application will be deployed to
        * title: the application name
        * vendor: your company name
        * pack200: create pack200 archives for quicker client downloads
        * signStorePass: the password to your Java certificate store (used to sign the jars)
        * signAlias: the name of the certificate to use (used to sign the jars)
        -->
        <jw:jnlpwar
           tofile="docx4all.war"
           codebase="/docx4all"
           title="docx4all"
           vendor="localhost"
           pack200="true"
           signStorepass="password"
           signAlias="alias">
            <!-- should work with a key defined as follows:
           
                    keytool -genkey -alias alias -dname "CN=A Developer, O=Open Source" -validity 9999 -keystore .keystore -keypass password -storepass password
                   
                    -->
           
                <!-- Add a normal and a short description -->
                <jw:description>cross platform WYSIWYG editor for docx files</jw:description>
                <jw:description kind="short">cross platform WYSIWYG editor for docx files</jw:description>
                <!-- Add an icon for the application
               <jw:icon file="path/to/icon.jpg"/> -->
                <!-- Show a splash screen when the application launches
               <jw:icon kind="splash" file="path/to/splash.jpg"/> -->
                <!-- Specify the minimal version of Java required by the app, along with
                some command-line arguments -->
                <jw:j2se minVersion="1.5"> <!-- task doesn't support 1.6, nor href="http://java.sun.com/products/autodl/j2se" -->
                </jw:j2se>
                <!-- Add the libraries used by the application -->
                <lib dir="${lib}">
                    <include name="**/*.jar"/>
                </lib>
                <!-- Specify the main class for the application,
                and the jar it is located in (can be duplicate from the lib element) -->
                <jw:application mainclass="org.docx4all.ui.main.WordMLEditor" jar="docx4all.jar"/>
        </jw:jnlpwar>
    </target>  
 
Parsed in 0.004 seconds, using GeSHi 1.0.8.4