users@glassfish.java.net

Re: How do I use glassfish to bind a java.net.URL Resource Reference

From: <glassfish_at_javadesktop.org>
Date: Fri, 14 Mar 2008 05:12:51 PST

HI again

Well, I thought that this would be a painless process with the code you supplied. However, when trying to set up the references in my web.xml, and sun-web.xml, I have run into problems.

I am trying this on Sun Appserver 9.1

in web.xml I have the standard resource reference..shouldn't be any problems here.

    <resource-ref>
        <res-ref-name>InquiryPortalURL</res-ref-name>
        <res-type>java.net.URL</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>

In my sun-web.xml, I have the following. I used Netbeans IDE to create this.

  <resource-ref>
    <res-ref-name>InquiryPortalURL</res-ref-name>
    <jndi-name>url/InquiryPortal</jndi-name>
  </resource-ref>

I now get the following error upon deployment of my ear.

WEB0123: WebModule [/SB] failed to deploy and has been disabled
javax.naming.InvalidNameException: Malformed URL:`url/InquiryPortal`

This makes no sense to me, as `url/InquiryPortal` is a jndi name, not an URL. Anybody have any idea what is going on here? Is this a bug in Sun App Server?

Thanks for you help

Pat
[Message sent by forum member 'pmccabe' (pmccabe)]

http://forums.java.net/jive/thread.jspa?messageID=263997