On 1/26/06, Geoffrey De Smet <[EMAIL PROTECTED]> wrote:
> On the first attempt this afternoon, the first error I had, resolved
> when I did "mvn install" before "mvn webstart:jnlp". This will have been
> the reason what it failed this morning too probably.
> In any case the updated version from the trunk warned me that it was due
> the module I am building, so therefor I tried an install which fixed
> that error.

You mean that if you don't run mvn install before .

I never use the webstart plugin on the command line. It's always
specified in my pom and mapped to a particular phase. That may be the
reason we see the different behavior.

Maybe the error message could then be improved to better fit your use
case. Could you try cleaning your local repository (of your project)
and do 'mvn -X webstart:jnlp' again, then send me the log?

> On the next attempt it nicely signed my jars but I got this error:
> Embedded error: Could not load the template file from 'src/jnlp/template.vm'

Do you find the error message explicit enough?

> I am sure I can create my own jnlp template to fix this, but I was
> wondering if the plugin can't hold a few standard templates, using the
> same mechanism that the assembly plugin uses:
> Either you supply a <templatePath> or a <templateId> property.
> Several templates could be already included in the plugin, such as
> "standalone" and "clientServer" (with a $$codebase to be set by the jnlp
> servlet).

That could be a nice enhancement. Just for the sake of giving examples.
Do you think you could create one such default template?


> PS: take a look at the release of the jnlp servlet
> https://deployment.dev.java.net/servlets/NewsItemView?newsItemID=3211
> to set the server codebase in the jnlp file at runtime.

The JnlpServlet is already a sub-module of the webstart plugin. Not
the one found on deployment.dev.java.net but the official Sun one.

> PPS: I am using this code to find my server codebase on the client:
>      /**
>       * Uses the jnlp API to determine the webapp context.
>       * If used outside of webstart,
> <code>fallBackWebAppContextUrl</code> is returned.
>       * For example this could return
> <code>http://localhost:8080/mywebapp/</code>.
>       *
>       * @return the url to the webapp ending with a slash
>       */
>      public String getWebAppContextUrl() {
>          String webAppContextUrl;
>          try {
>              BasicService basicService = (BasicService)
> ServiceManager.lookup("javax.jnlp.BasicService");
>              String codeBase = basicService.getCodeBase().toExternalForm();
>              if (!codeBase.endsWith("/")) {
>                  codeBase += "/";
>              }
>              int webAppContextUrlLength =
> codeBase.lastIndexOf(jnlpRelativeDirectoryPathFromWebAppContext);
>              webAppContextUrl = codeBase.substring(0,
> webAppContextUrlLength + 1);
>          } catch (UnavailableServiceException e) {
>              // TODO logging
>              webAppContextUrl = fallBackWebAppContextUrl;
>          }
>          return webAppContextUrl;
>      }

It might be a good addition to the documentation, section "jnlp 101"

I will try to split that doc.

Jerome

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to