unable to load resource with webstart-maven-plugin

View: New views
4 Messages — Rating Filter:   Alert me  

unable to load resource with webstart-maven-plugin

by stevenmaring :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm getting ...

java.io.FileNotFoundException: http://localhost:9090/release-deployer-webstart/webstart/release-deployer.jar?version-id=1.0.0

when I try to kick off my app with ...

javaws http://localhost:9090/release-deployer-webstart/webstart/launch.jnlp


Basically, it seems as though the Sun JNLP Servlet is trying to load my "release-deployer-1.0.0.jar" by referencing it as "release-deployer.jar?version-id=1.0.0" and it isn't working.


Archive:  release-deployer-webstart.war
  Length     Date   Time    Name
 --------    ----   ----    ----
        0  10/23/09 12:01   META-INF/
      127  10/23/09 12:01   META-INF/MANIFEST.MF
        0  10/23/09 11:20   WEB-INF/
        0  10/23/09 11:20   WEB-INF/classes/
        0  10/23/09 12:01   WEB-INF/lib/
        0  10/23/09 12:01   webstart/
    61726  10/21/09 09:32   WEB-INF/lib/jnlp-servlet-1.6.0_16.jar
      472  10/21/09 08:57   WEB-INF/web.xml
    12288  10/23/09 12:01   webstart/.launch.jnlp.swp
      575  10/23/09 12:01   webstart/launch.jnlp
  3359484  10/23/09 12:01   webstart/release-deployer-1.0.0.jar
      242  10/23/09 12:01   webstart/version.xml



my pom.xml:

        <plugin>
            <groupId>org.codehaus.mojo.webstart</groupId>
            <artifactId>webstart-maven-plugin</artifactId>
            <version>1.0-alpha-2</version>
            <executions>
                <execution>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>jnlp-download-servlet</goal>
                    </goals>
                </execution>
            </executions>

            <configuration>
            <templateDirectory>src/main/jnlp</templateDirectory>
            <workDirectory>target/jnlp</workDirectory>
                <outputDirectoryName>webstart</outputDirectoryName>
                  <excludeTransitive>true</excludeTransitive>
               
                <jnlpFiles>
                    <jnlpFile>
                        <templateFilename>jnlpTemplate.vm</templateFilename>
                        <outputFilename>launch.jnlp</outputFilename> <!-- when there's only one jnlpFile, can be optioanl and defaults to launch.jnlp -->
                        <jarResources>
                            <jarResource>
                                <groupId>com.example</groupId>
                                <artifactId>release-deployer</artifactId>
                                <version>1.0.0</version>
                                <mainClass>com.example.MyMain</mainClass>
                            </jarResource>
                        </jarResources>
                    </jnlpFile>
                </jnlpFiles>

                <sign>
                    <keystore>${project.build.directory}/keyStore</keystore> <!-- path or URI (if empty, the default keystore ".keystore"-file in the user-homedir is used) -->
                    <keypass>password</keypass>  <!-- we need to override passwords easily from the command line. ${keypass} -->
                    <storepass>password</storepass> <!-- ${storepass} -->
                    <alias>webstart</alias> <!-- alias of the key to  use -->

                    <!-- the following key-settings are only used if the keystore and key has to be generated at build-time -->
                    <storetype>jks</storetype>
                    <validity>365</validity>
                    <dnameCn>Name</dnameCn>
                    <dnameOu>Name</dnameOu>
                    <dnameO>Name</dnameO>
                    <dnameL>Tampa</dnameL>
                    <dnameSt>Florida</dnameSt>
                    <dnameC>US</dnameC>

                    <!-- KEYSTORE MANAGEMENT -->
                    <keystoreConfig>
                        <delete>true</delete> <!-- delete the keystore at build time -->
                        <gen>true</gen>       <!-- generate keystore and key at build time -->
                    </keystoreConfig>

                    <verify>false</verify> <!-- verify the signature after signing -->
                </sign>
                <unsign>true</unsign> <!-- unsign already signed packages and sign them with own key -->

                <verifyjar>false</verifyjar>
            </configuration>
        </plugin>

...

                <dependency>
       <groupId>com.sun.java.jnlp</groupId>
       <artifactId>jnlp-servlet</artifactId>
       <version>1.6.0_16</version>
       <scope>runtime</scope>
                </dependency>


launch.jnlp:

<jnlp spec="1.0+" codebase="$$codebase" context="$$context" href="$$name">
        <information>
                <title>Release Deployer WebStart</title>
                <vendor>Name</vendor>
                <homepage href="http://maven.apache.org"/>
                <description>$project.Description</description>
                                        <offline-allowed/>
                        </information>
                        <security>
                        <all-permissions/>
                </security>
        <resources>
                <j2se version="1.5+"/>
<jar href="release-deployer.jar" version="1.0.0" main="true"/>
        </resources>
        <application-desc main-class="com.example.MyMain"/>
</jnlp>


Thanks,
Steve Maring

Re: unable to load resource with webstart-maven-plugin

by stevenmaring :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the version.xml file seems to be fine ...

<?xml version="1.0"?>
<jnlp-versions>
  <resource>
    <pattern>
      <name>release-deployer.jar</name>
      <version-id>1.0.0</version-id>
    </pattern>
    <file>release-deployer-1.0.0.jar</file>
  </resource>
</jnlp-versions>



stevenmaring wrote:
I'm getting ...

java.io.FileNotFoundException: http://localhost:9090/release-deployer-webstart/webstart/release-deployer.jar?version-id=1.0.0

when I try to kick off my app with ...

javaws http://localhost:9090/release-deployer-webstart/webstart/launch.jnlp


Basically, it seems as though the Sun JNLP Servlet is trying to load my "release-deployer-1.0.0.jar" by referencing it as "release-deployer.jar?version-id=1.0.0" and it isn't working.


Archive:  release-deployer-webstart.war
  Length     Date   Time    Name
 --------    ----   ----    ----
        0  10/23/09 12:01   META-INF/
      127  10/23/09 12:01   META-INF/MANIFEST.MF
        0  10/23/09 11:20   WEB-INF/
        0  10/23/09 11:20   WEB-INF/classes/
        0  10/23/09 12:01   WEB-INF/lib/
        0  10/23/09 12:01   webstart/
    61726  10/21/09 09:32   WEB-INF/lib/jnlp-servlet-1.6.0_16.jar
      472  10/21/09 08:57   WEB-INF/web.xml
    12288  10/23/09 12:01   webstart/.launch.jnlp.swp
      575  10/23/09 12:01   webstart/launch.jnlp
  3359484  10/23/09 12:01   webstart/release-deployer-1.0.0.jar
      242  10/23/09 12:01   webstart/version.xml



my pom.xml:

        <plugin>
            <groupId>org.codehaus.mojo.webstart</groupId>
            <artifactId>webstart-maven-plugin</artifactId>
            <version>1.0-alpha-2</version>
            <executions>
                <execution>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>jnlp-download-servlet</goal>
                    </goals>
                </execution>
            </executions>

            <configuration>
            <templateDirectory>src/main/jnlp</templateDirectory>
            <workDirectory>target/jnlp</workDirectory>
                <outputDirectoryName>webstart</outputDirectoryName>
                  <excludeTransitive>true</excludeTransitive>
               
                <jnlpFiles>
                    <jnlpFile>
                        <templateFilename>jnlpTemplate.vm</templateFilename>
                        <outputFilename>launch.jnlp</outputFilename> <!-- when there's only one jnlpFile, can be optioanl and defaults to launch.jnlp -->
                        <jarResources>
                            <jarResource>
                                <groupId>com.example</groupId>
                                <artifactId>release-deployer</artifactId>
                                <version>1.0.0</version>
                                <mainClass>com.example.MyMain</mainClass>
                            </jarResource>
                        </jarResources>
                    </jnlpFile>
                </jnlpFiles>

                <sign>
                    <keystore>${project.build.directory}/keyStore</keystore> <!-- path or URI (if empty, the default keystore ".keystore"-file in the user-homedir is used) -->
                    <keypass>password</keypass>  <!-- we need to override passwords easily from the command line. ${keypass} -->
                    <storepass>password</storepass> <!-- ${storepass} -->
                    <alias>webstart</alias> <!-- alias of the key to  use -->

                    <!-- the following key-settings are only used if the keystore and key has to be generated at build-time -->
                    <storetype>jks</storetype>
                    <validity>365</validity>
                    <dnameCn>Name</dnameCn>
                    <dnameOu>Name</dnameOu>
                    <dnameO>Name</dnameO>
                    <dnameL>Tampa</dnameL>
                    <dnameSt>Florida</dnameSt>
                    <dnameC>US</dnameC>

                    <!-- KEYSTORE MANAGEMENT -->
                    <keystoreConfig>
                        <delete>true</delete> <!-- delete the keystore at build time -->
                        <gen>true</gen>       <!-- generate keystore and key at build time -->
                    </keystoreConfig>

                    <verify>false</verify> <!-- verify the signature after signing -->
                </sign>
                <unsign>true</unsign> <!-- unsign already signed packages and sign them with own key -->

                <verifyjar>false</verifyjar>
            </configuration>
        </plugin>

...

                <dependency>
       <groupId>com.sun.java.jnlp</groupId>
       <artifactId>jnlp-servlet</artifactId>
       <version>1.6.0_16</version>
       <scope>runtime</scope>
                </dependency>


launch.jnlp:

<jnlp spec="1.0+" codebase="$$codebase" context="$$context" href="$$name">
        <information>
                <title>Release Deployer WebStart</title>
                <vendor>Name</vendor>
                <homepage href="http://maven.apache.org"/>
                <description>$project.Description</description>
                                        <offline-allowed/>
                        </information>
                        <security>
                        <all-permissions/>
                </security>
        <resources>
                <j2se version="1.5+"/>
<jar href="release-deployer.jar" version="1.0.0" main="true"/>
        </resources>
        <application-desc main-class="com.example.MyMain"/>
</jnlp>


Thanks,
Steve Maring

Re: unable to load resource with webstart-maven-plugin

by stevenmaring :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I tried a web.xml like this ...

<web-app>
    <servlet>
        <servlet-name>JnlpDownloadServlet</servlet-name>
        <servlet-class>jnlp.sample.servlet.JnlpDownloadServlet</servlet-class>
    </servlet>
   
    <servlet-mapping>
        <servlet-name>JnlpDownloadServlet</servlet-name>
        <url-pattern>/webstart/*</url-pattern>
    </servlet-mapping>
</web-app>

but it just says ...

com.sun.deploy.net.FailedDownloadException: Unable to load resource: (http://localhost:9090/release-deployer-webstart/webstart/release-deployer.jar?version-id=1.0.0, 1.0.0)

seems to add another version number at the end, whereas I had "<url-pattern>*.jnlp</url-pattern>" before, but did help matters any




the version.xml file seems to be fine ...

<?xml version="1.0"?>
<jnlp-versions>
  <resource>
    <pattern>
      <name>release-deployer.jar</name>
      <version-id>1.0.0</version-id>
    </pattern>
    <file>release-deployer-1.0.0.jar</file>
  </resource>
</jnlp-versions>



stevenmaring wrote:
I'm getting ...

java.io.FileNotFoundException: http://localhost:9090/release-deployer-webstart/webstart/release-deployer.jar?version-id=1.0.0

when I try to kick off my app with ...

javaws http://localhost:9090/release-deployer-webstart/webstart/launch.jnlp


Basically, it seems as though the Sun JNLP Servlet is trying to load my "release-deployer-1.0.0.jar" by referencing it as "release-deployer.jar?version-id=1.0.0" and it isn't working.


Archive:  release-deployer-webstart.war
  Length     Date   Time    Name
 --------    ----   ----    ----
        0  10/23/09 12:01   META-INF/
      127  10/23/09 12:01   META-INF/MANIFEST.MF
        0  10/23/09 11:20   WEB-INF/
        0  10/23/09 11:20   WEB-INF/classes/
        0  10/23/09 12:01   WEB-INF/lib/
        0  10/23/09 12:01   webstart/
    61726  10/21/09 09:32   WEB-INF/lib/jnlp-servlet-1.6.0_16.jar
      472  10/21/09 08:57   WEB-INF/web.xml
    12288  10/23/09 12:01   webstart/.launch.jnlp.swp
      575  10/23/09 12:01   webstart/launch.jnlp
  3359484  10/23/09 12:01   webstart/release-deployer-1.0.0.jar
      242  10/23/09 12:01   webstart/version.xml



my pom.xml:

        <plugin>
            <groupId>org.codehaus.mojo.webstart</groupId>
            <artifactId>webstart-maven-plugin</artifactId>
            <version>1.0-alpha-2</version>
            <executions>
                <execution>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>jnlp-download-servlet</goal>
                    </goals>
                </execution>
            </executions>

            <configuration>
            <templateDirectory>src/main/jnlp</templateDirectory>
            <workDirectory>target/jnlp</workDirectory>
                <outputDirectoryName>webstart</outputDirectoryName>
                  <excludeTransitive>true</excludeTransitive>
               
                <jnlpFiles>
                    <jnlpFile>
                        <templateFilename>jnlpTemplate.vm</templateFilename>
                        <outputFilename>launch.jnlp</outputFilename> <!-- when there's only one jnlpFile, can be optioanl and defaults to launch.jnlp -->
                        <jarResources>
                            <jarResource>
                                <groupId>com.example</groupId>
                                <artifactId>release-deployer</artifactId>
                                <version>1.0.0</version>
                                <mainClass>com.example.MyMain</mainClass>
                            </jarResource>
                        </jarResources>
                    </jnlpFile>
                </jnlpFiles>

                <sign>
                    <keystore>${project.build.directory}/keyStore</keystore> <!-- path or URI (if empty, the default keystore ".keystore"-file in the user-homedir is used) -->
                    <keypass>password</keypass>  <!-- we need to override passwords easily from the command line. ${keypass} -->
                    <storepass>password</storepass> <!-- ${storepass} -->
                    <alias>webstart</alias> <!-- alias of the key to  use -->

                    <!-- the following key-settings are only used if the keystore and key has to be generated at build-time -->
                    <storetype>jks</storetype>
                    <validity>365</validity>
                    <dnameCn>Name</dnameCn>
                    <dnameOu>Name</dnameOu>
                    <dnameO>Name</dnameO>
                    <dnameL>Tampa</dnameL>
                    <dnameSt>Florida</dnameSt>
                    <dnameC>US</dnameC>

                    <!-- KEYSTORE MANAGEMENT -->
                    <keystoreConfig>
                        <delete>true</delete> <!-- delete the keystore at build time -->
                        <gen>true</gen>       <!-- generate keystore and key at build time -->
                    </keystoreConfig>

                    <verify>false</verify> <!-- verify the signature after signing -->
                </sign>
                <unsign>true</unsign> <!-- unsign already signed packages and sign them with own key -->

                <verifyjar>false</verifyjar>
            </configuration>
        </plugin>

...

                <dependency>
       <groupId>com.sun.java.jnlp</groupId>
       <artifactId>jnlp-servlet</artifactId>
       <version>1.6.0_16</version>
       <scope>runtime</scope>
                </dependency>


launch.jnlp:

<jnlp spec="1.0+" codebase="$$codebase" context="$$context" href="$$name">
        <information>
                <title>Release Deployer WebStart</title>
                <vendor>Name</vendor>
                <homepage href="http://maven.apache.org"/>
                <description>$project.Description</description>
                                        <offline-allowed/>
                        </information>
                        <security>
                        <all-permissions/>
                </security>
        <resources>
                <j2se version="1.5+"/>
<jar href="release-deployer.jar" version="1.0.0" main="true"/>
        </resources>
        <application-desc main-class="com.example.MyMain"/>
</jnlp>


Thanks,
Steve Maring


Re: unable to load resource with webstart-maven-plugin

by Andrew Goodnough-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Fri, Oct 23, 2009 at 12:11 PM, stevenmaring <steve.maring@...> wrote:
>>
>> <jnlp spec="1.0+" codebase="$$codebase" context="$$context"
>> href="$$name">
>>      <information>
>>              <title>Release Deployer WebStart</title>
>>              <vendor>Name</vendor>
>>              <homepage href="http://maven.apache.org"/>
>>              <description>$project.Description</description>
>>                                      <offline-allowed/>
>>                      </information>
>>                      <security>
>>                      <all-permissions/>
>>              </security>
>>      <resources>
>>              <j2se version="1.5+"/>
>> <jar href="release-deployer.jar" version="1.0.0" main="true"/>
>>      </resources>
>>      <application-desc main-class="com.example.MyMain"/>
>> </jnlp>
>>
>>
>> Thanks,
>> Steve Maring

I can't help you with the theory about why this is failing but if you just want it to work... if you remove the version property from the jar element and reference the real jar name with the version, it should work.  So change:

<jar href="release-deployer.jar" version="1.0.0" main="true"/>

to

<jar href="release-deployer-1.0.0.jar" main="true"/>

in your .jnlp file.

Also, this will be how the JNLP will be generated if you set

<outputJarVersions>false</outputJarVersions>

in the jnlp section of your pom.xml.

Andy