Glassfish Server Library not available in Eclipse Kepler?
Asked Answered
T

4

11

I'm setting up a new dev machine with Eclipse Kepler to deploy on a Glassfish 3.1.2.2 instance.

When I go to

project properties > java build path > libraries > add library > server runtime

There is no option to add the Glassfish server libraries.

Some other notes of what I've done (whether they help or not...):

  • Manually installed GF
  • Installed OEPE for Juno
  • GF Server already added
  • GF Server starts / stops no problem (from Eclipse)

I pretty much had the same setup on my other machine with the exception that I used Juno instead of Kepler (however, I tried the above with a fresh Juno install as well). That machine has everything working but was set up a while ago. From what I understand, there has been a lot of changes with GF, Eclipse plugins and such: https://blogs.oracle.com/piotrik/entry/glassfish_3_1_2_2 . So perhaps it's still under works and not fully ready?

In the meantime, I created a User Library with the Glassfish jar files from the Modules folder. Not the ideal solution but it works for now.

However, I still rather have the "cleaner" method of adding a Server Runtime instead. Ideas?

Tweet answered 20/6, 2013 at 1:52 Comment(0)
Z
25

See the thread GlassFish Tools does not provide a Server Runtime for Java Build Path in the Oracle forum.

Summary: They no longer provide a "Server Runtime" for plain Java projects. Instead, the project needs to be a faceted project and have a target runtime.

To configure this, do the following:

  1. Go to the project properties > Project Facets
  2. If necessary, click on Convert to faceted form...
  3. In the Runtimes tab, select GlassFish 3.1

In case you need to export the GlassFish libraries to dependent projects, also do the following:

  1. In Project Facets properties, select Utility Module and click Apply
  2. In Java Build Path > Order and Export, select GlassFish System Libraries
Zoe answered 2/7, 2013 at 11:47 Comment(1)
Works perfectly. Thanks for the info update and a clean solution.Tweet
P
3

Someone has reported this issue in the Oracle Glassfish Tools forum. A fix will be included in the next release, which "will be out before too long".

See https://forums.oracle.com/thread/2552592

I ended up installing "GlassFish Tools for Indigo" from Help > Eclipse Marketplace...

Papp answered 1/7, 2013 at 7:19 Comment(1)
Can you do that with Eclipse Kepler ?Curkell
G
1

Looks like a bug in Eclipse Kepler / Glassfish Server Tools.

You can try the following:

Add this in your projects .classpath file:

<classpathentry kind="con" path="oracle.eclipse.tools.glassfish.lib.system">
    <attributes>
        <attribute name="owner.project.facets" value="jst.web"/>
    </attributes>
</classpathentry>

Update the file YOUR_PROJECT/.settings/org.eclipse.wst.common.project.facet.core.xml to look like this:

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <runtime name="GlassFish 3.1"/>  <-- Insert the name of your Glassfish Runtime in Eclipse here 
  <fixed facet="jst.web"/>
  <fixed facet="java"/>
  <fixed facet="wst.jsdt.web"/>
  <installed facet="java" version="1.7"/>
  <installed facet="jst.web" version="3.0"/>
  <installed facet="glassfish.web" version="3.1"/> <-- Glassfish Version here
  <installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>

You have to choose the appropriate runtime name which you defined in Eclipse.

Graniteware answered 20/6, 2013 at 10:34 Comment(0)
L
0

Goto Project Properties > Project Facets > Under the tabs 'Runtimes' > Select the glass fish server and click on Apply. This will setup the GF Java EE libraries in the build path.

Landman answered 8/1, 2015 at 8:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.