Hi Andreas,
I'm glad you got it sorted out. I'm guessing you got your url-pattern
from the example on this page:

http://mojo.codehaus.org/webstart/webstart-maven-plugin/jnlp101.html

Sorry, but that example is incorrect (as you've discovered) and I'll see
about getting it fixed. The correct examples are on these pages:

http://mojo.codehaus.org/webstart/webstart-maven-plugin/examples/simple_jnlp_download_servlet.html
http://mojo.codehaus.org/webstart/webstart-maven-plugin/examples/advanced_jnlp_download_servlet.html


Cheers,
Kevin


On Fri, 2008-02-22 at 12:40 +0100, Kuhtz, Andreas wrote:

> Hi Kevin,
> 
> It works now, thanks to your hints and once again consulting the
> JnlpDownloadServlet Guide ;-)
> 
> The problem was the url-pattern in the web.xml that is different for
> version-download protocol. After I replaced the
> <url-pattern>*.jnlp</url-pattern> with
> <url-pattern>/webstart/*</url-pattern> it works perfect. 
> 
> If you have the wrong url-pattern you get an exception like this:
> 
> com.sun.deploy.net.FailedDownloadException: Ressource konnte nicht
> geladen werden:
> (http://localhost:8080/authorization-client-webstart-1.0-SNAPSHOT/websta
> rt/authorization-client-appl.jar?version-id=1.0-SNAPSHOT, 1.0-SNAPSHOT)
>       at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown
> Source)
>       at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown
> Source)
>       at
> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
>       at
> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
>       at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
>       at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown
> Source)
>       at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown
> Source)
> 
> 
> Maybe you can add a hint to the documentation ;-)
> 
> Thanks again!
> 
> Cheers,
> Andreas
> 
> 
> -----Original Message-----
> From: Kevin Stembridge [mailto:[EMAIL PROTECTED] 
> Sent: Freitag, 22. Februar 2008 09:47
> To: [email protected]
> Subject: Re: [mojo-user] webstart-maven-plugin Problems with
> jnlp-download-servlet
> 
> Hi Andreas,
> Can you confirm that you are using Sun's JnlpDownloadServlet? Could
> you post the error you are getting?
> 
> You will probably notice that a file called version.xml is also
> generated by the mojo in the same directory as the generated JNLP
> file. This is used by Sun's Jnlp download servlet to map the incoming
> request from the JNLP client (e.g. Webstart ) to the actual jar file
> to be served up. Specifying the version number in a separate attribute
> allows the download servlet to be a bit smarter about how it serves up
> files. For example, it can create a jar diff between the version that
> the client currently has and the version specified in the most
> recently downloaded JNLP file.
> 
> Let me know if you have any more questions but I'll be offline for a
> few days so I may not get back to you straight away.
> 
> Cheers,
> Kevin
> 
> 
> On Tue, Feb 19, 2008 at 1:53 AM, Kuhtz, Andreas
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I'm using the webstart-maven-plugin (1.0-beta-1-SNAPSHOT) to create a
> WAR
> > file with 2 jnlp files. The creation works but I've problems with the
> > content of the generated jnlp-files:
> > The jar-entries (<jar href="xxxx.jar" />) misses the version in the
> filename
> > of the jar, e.g. log4j.jar instead of log4j-1.2.14.jar. Instead the
> version
> > of the jar file is entered in a separate attribute version="1.12.14".
> > When I try to load the JNLP files from Jetty or Tomcat I always get an
> > error.
> >
> > I've changed the JnlpDownloadServletMojo.java to add the version to
> the
> > filename and not to output the version of the jar in the JNLP file and
> this
> > works for me. However I'd like to know how the current implementation
> (with
> > the output of the version and the filename without the version) works
> ;-)
> >
> > See the changes to JnlpDownloadServletMojo.java below that works for
> me.
> >
> > Thanks,
> > Andi
> >
> > --- C:\Documents and Settings\chakuht0\Local
> > Settings\Temp\JnlpDownloadServletMojo.java-revBASE.svn000.tmp.java
> > 2008-02-19 11:47:52.000000000 +-0100
> > +++
> >
> D:\virt\Java_Projects\webstart-maven-plugin\src\main\java\org\codehaus\m
> ojo\webstart\JnlpDownloadServletMojo.java
> > 2008-02-19 07:57:32.000000000 +-0100
> > @@ -398,12 +399,13 @@
> >          {
> >              //for each configured JarResource, create and resolve the
> > corresponding artifact and
> >              //check it for the mainClass if specified
> >              for (  Iterator itr = jarResources.iterator();
> itr.hasNext(); )
> >              {
> >                  JarResource jarResource = (JarResource) itr.next();
> > +    jarResource.setOutputJarVersion( /*true*/ false );  // kuz
> >                  Artifact artifact = createArtifact(jarResource);
> >                  getArtifactResolver().resolve( artifact,
> > getRemoteRepositories(), getLocalRepository() );
> >                  jarResource.setArtifact( artifact );
> >                  checkForMainClass( jarResource );
> >                  jarResourceArtifacts.add( artifact );
> >              }
> > @@ -558,13 +560,13 @@
> >              // we should really improve the way we collect the
> jarResources
> >              if ( !jarResourceArtifacts.contains( resolvedArtifact ) )
> >              {
> >                  JarResource newJarResource = new
> > JarResource(resolvedArtifact);
> >                  if ( !jarResources.contains( newJarResource ) )
> >                  {
> > -                    newJarResource.setOutputJarVersion( true );
> > +                    newJarResource.setOutputJarVersion( /*true*/
> false );
> > // kuz
> >                      jarResources.add( newJarResource );
> >                  }
> >              }
> >
> >          }
> >
> > @@ -685,12 +687,17 @@
> >       */
> >      private String buildHrefValue( Artifact artifact )
> >      {
> >          StringBuffer sbuf = new StringBuffer();
> >          sbuf.append( artifact.getArtifactId() );
> >
> > +        if ( StringUtils.isNotEmpty( artifact.getVersion() ) )
> > +        {
> > +            sbuf.append( "-" ).append( artifact.getVersion() );
> > +        }
> > +
> >          if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
> >          {
> >              sbuf.append( "-" ).append( artifact.getClassifier() );
> >          }
> >
> >          sbuf.append( "." ).append(
> > artifact.getArtifactHandler().getExtension() );
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 

Reply via email to