Skip to main content

Problem with adding libraries (jcr-2.0.jar) to glassfish

2 replies [Last post]
kithouna
Offline
Joined: 2011-03-28

Hey guys,

I'm desperately trying to add the jcr-2.0.jar to my domain-specific libraries.
I already tried dropping the jar at /domains/{mydomain}/lib and /domains/{mydomain}/lib/ext and I already tried installing it via the admin UI (add-libraries --type=ext) and so on. But then in netbeans, when I try to use an import from it (import javax.jcr.repository e.g) it cannot find it. The server I used runs on a different machine maybe that's the problem??
What can I do?

thanks for your help

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jdlee
Offline
Joined: 2006-01-25

Installing it (either manually or via asadmin) only updates the server.
I could be wrong, but I don't think NetBeans uses the server's library
and module list for building, etc. I think you're going to have to add
that library to your project (e.g., your Maven pom) as well for NB to
find it.

On 09/20/2012 06:49 AM, forums@java.net wrote:
> Hey guys, I'm desperately trying to add the jcr-2.0.jar to my
> domain-specific
> libraries. I already tried dropping the jar at /domains/{mydomain}/lib
> and
> /domains/{mydomain}/lib/ext and I already tried installing it via the
> admin
> UI (add-libraries --type=ext) and so on. But then in netbeans, when I
> try to
> use an import from it (import javax.jcr.repository e.g) it cannot find
> it.
> The server I used runs on a different machine maybe that's the
> problem?? What
> can I do? thanks for your help
>
> --
>
> [Message sent by forum member 'kithouna']
>
> View Post: http://forums.java.net/node/890403
>
>

--
Jason Lee
Principal Member of Technical Staff
GlassFish Team

Oracle Corporation
Phone +1 405-216-3193
Blog http://blogs.steeplesoft.com

kithouna
Offline
Joined: 2011-03-28

Yes you were right I thought netbeans might get the server libraries by itself but that doesn't work. If anyone has this problem :

Click "Tools" in the menu and then add the library through "Ant Libraries". Next click "net Library" and specify your library. It's important to change the "Library type" so "Server library". That should do it.