Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Eclipse and Glassfish
Eclipse and Glassfish [message #226175] Wed, 07 January 2009 15:22 Go to next message
Anna  is currently offline Anna
Messages: 24
Registered: July 2009
Junior Member
Hello!

The Eclipse does not recognize that Glassfish server is already running
and tries to start it whenever I attempt to deploy an application.
Obviously the message immediately comes upt: "The server is already
running".

I tried to start the server from both inside and outside the Eclipse, and
still the same result - the status of the server on the Eclipse server
view is shown as "stopped".

What's wrong with my settings?

One more thing I would like to ask:
where does Eclipse put .WAR file that it creates when building a web
application?

I'll really appreciate any type of help.

Anna
Re: Eclipse and Glassfish [message #226209 is a reply to message #226175] Thu, 08 January 2009 10:30 Go to previous messageGo to next message
Eclipse User
Originally posted by: dcarver.starstandard.org

You might get a better response from the developers of the Glassfish
server plugin for Eclipse.

https://glassfishplugins.dev.java.net/

Dave

Anna wrote:
> Hello!
>
> The Eclipse does not recognize that Glassfish server is already running
> and tries to start it whenever I attempt to deploy an application.
> Obviously the message immediately comes upt: "The server is already
> running".
>
> I tried to start the server from both inside and outside the Eclipse,
> and still the same result - the status of the server on the Eclipse
> server view is shown as "stopped".
>
> What's wrong with my settings?
>
> One more thing I would like to ask:
> where does Eclipse put .WAR file that it creates when building a web
> application?
>
> I'll really appreciate any type of help.
>
> Anna
>
>
>
>
>
Re: Eclipse and Glassfish [message #226250 is a reply to message #226175] Thu, 08 January 2009 16:14 Go to previous messageGo to next message
Eclipse User
Originally posted by: Kevin.REMOVE.Dean.datadevelopment.com

Anna wrote:

>Hello!
>
>The Eclipse does not recognize that Glassfish server is already running
>and tries to start it whenever I attempt to deploy an application.
>Obviously the message immediately comes upt: "The server is already
>running".
>
>I tried to start the server from both inside and outside the Eclipse, and
>still the same result - the status of the server on the Eclipse server
>view is shown as "stopped".
>
>What's wrong with my settings?
>
>One more thing I would like to ask:
>where does Eclipse put .WAR file that it creates when building a web
>application?
>
>I'll really appreciate any type of help.
>
>Anna

The server must be started only from within Eclipse. If you are indeed
doing so, check the Console window for any error messages on startup that
would indicate why Eclipse is losing the connection to Glassfish.

One of the many aggravating features of Eclipse is that it doesn't really
build WAR or EAR files except as temporary artifacts. This makes it very
difficult to build production files because you usually don't have access
to the production server from your development environment. The only
marginally useful suggestion I have ever had for this is to pick up the
WAR file from the Glassfish domain applications directory.

--
Re: Eclipse and Glassfish [message #226277 is a reply to message #226250] Fri, 09 January 2009 01:15 Go to previous messageGo to next message
Eclipse User
Originally posted by: dcarver.starstandard.org

Kevin Dean wrote:
> One of the many aggravating features of Eclipse is that it doesn't
> really build WAR or EAR files except as temporary artifacts. This makes
> it very difficult to build production files because you usually don't
> have access to the production server from your development environment.
> The only marginally useful suggestion I have ever had for this is to
> pick up the WAR file from the Glassfish domain applications directory.

You can build a WAR file for deploying by going Exporting the project as
a WAR. Should be in File->Export or right click on the project and
select Export

Dave
Re: Eclipse and Glassfish [message #226303 is a reply to message #226277] Fri, 09 January 2009 07:39 Go to previous messageGo to next message
Eclipse User
Originally posted by: Kevin.REMOVE.Dean.datadevelopment.com

David Carver wrote:

>You can build a WAR file for deploying by going Exporting the project as a
>WAR. Should be in File->Export or right click on the project and select
>Export

True enough. The problem with that is the whole concept of a manual step
in what should, in my opinion, be an automated process. I see that as the
equivalent in Windows of having the development environment build all
object files and stop just short of building the executable, which has to
be done manually from a menu.

JAR files of any kind (WAR, EAR, etc.) should be build artifacts, not
manual selections.

--
Re: Eclipse and Glassfish [message #226354 is a reply to message #226250] Mon, 12 January 2009 14:21 Go to previous messageGo to next message
Anna  is currently offline Anna
Messages: 24
Registered: July 2009
Junior Member
Hi Kevin!

Thank you very much for your reply.

I didn't notice any error messages, but I will try different ways of
starting Glassfish and see what happens.

But where can I find .WAR file of my web application?
You've mentioned Glassfish folder, but it's not there.
Here is my Glassfish folder structure:
C:\Sun\AppServer\domains\domain1\
Inside /domain1/:
Addons
Applications
Autodeploy
Bin
Config
Docroot
Generated
Imq
java-web-start
jbi
lib
logs
session-store
master-password

Where exactly that .WAR file should reside?

Thanks again,
Anna
Re: Eclipse and Glassfish [message #226361 is a reply to message #226277] Mon, 12 January 2009 14:34 Go to previous messageGo to next message
Anna  is currently offline Anna
Messages: 24
Registered: July 2009
Junior Member
It sounds like a great solution!
Where exactly should I export my project .WAR file to?

My server is structured as follows:
C:\Sun\AppServer\domains\domain1\
inside there are the following 14 items:
Addons
Applications
Autodeploy
Bin
Config
Docroot
Generated
Imq
java-web-start
jbi
lib
logs
session-store
master-password

Is it correct that if I had .WAR file I could manually deploy the
application by moveing .WAR file to AUTODEPLOY folder?

Is there a way to configure Eclipse so it creates and exports .WAR file
automatically?

Thank you very much,
Anna
Re: Eclipse and Glassfish [message #226368 is a reply to message #226303] Mon, 12 January 2009 14:46 Go to previous messageGo to next message
Anna  is currently offline Anna
Messages: 24
Registered: July 2009
Junior Member
If Eclipse is so inconvenient why then people use it? There are many other
IDEs.
I'm stuck with Eclipse because I'm using a screen reader and Eclipse is
very accessible.
But what makes you using it?
Re: Eclipse and Glassfish [message #226372 is a reply to message #226303] Mon, 12 January 2009 15:04 Go to previous messageGo to next message
Anna  is currently offline Anna
Messages: 24
Registered: July 2009
Junior Member
Would you please help me to understand the following.

Right now I have Eclipse closed but server running.
I open the browser and go to localhost with my project name.
The browser correctly displays the first page of my project.
How Glassfish knows that I previously deployed the project using Eclipse?
Where it finds the project if .WAR file doesn't exist?

Thank you very much.
Re: Eclipse and Glassfish [message #226378 is a reply to message #226303] Mon, 12 January 2009 15:13 Go to previous messageGo to next message
Eclipse User
Originally posted by: dcarver.starstandard.org

Kevin Dean wrote:
> David Carver wrote:
>
>> You can build a WAR file for deploying by going Exporting the project
>> as a WAR. Should be in File->Export or right click on the project
>> and select Export
>
> True enough. The problem with that is the whole concept of a manual
> step in what should, in my opinion, be an automated process. I see that
> as the equivalent in Windows of having the development environment build
> all object files and stop just short of building the executable, which
> has to be done manually from a menu.
>
> JAR files of any kind (WAR, EAR, etc.) should be build artifacts, not
> manual selections.
>

You are looking at it from two different points of view. The build
artifacts should be handled by your release engineering process. Which
in an enterprise application is typically a series of ANT files that run
to do actual deployments from a source code repository.

The developer implementation is different, as it assumes that each
developer has their own Tomcat or Glassfish testing server they are
using, so that is why the Server Adaptors are there. When you click the
publish operation on a Server Adaptor it publishes the WAR and other
files to that development server. It doesn't create a standard WAR to
be deployed, that is what the Export operation is for.

Two different use cases.

Dave
Re: Eclipse and Glassfish [message #226384 is a reply to message #226354] Mon, 12 January 2009 15:14 Go to previous messageGo to next message
Eclipse User
Originally posted by: dcarver.starstandard.org

You need to create the WAR file, simpliest way is to Export your project
to a WAR. Click on it, and select Export and follow the prompts from there.


Anna wrote:
> Hi Kevin!
>

> Thank you very much for your reply.
>
> I didn't notice any error messages, but I will try different ways of
> starting Glassfish and see what happens.
>
> But where can I find .WAR file of my web application? You've mentioned
> Glassfish folder, but it's not there.
> Here is my Glassfish folder structure:
> C:\Sun\AppServer\domains\domain1\
> Inside /domain1/:
> Addons
> Applications
> Autodeploy
> Bin
> Config
> Docroot
> Generated
> Imq
> java-web-start
> jbi
> lib
> logs
> session-store
> master-password
>
> Where exactly that .WAR file should reside?
>
> Thanks again,
> Anna
>
>
>
>
>
Re: Eclipse and Glassfish [message #226546 is a reply to message #226378] Tue, 13 January 2009 11:14 Go to previous messageGo to next message
Anna  is currently offline Anna
Messages: 24
Registered: July 2009
Junior Member
David and Kevin, thank you so much!

Would you please help me to solve my other problem, I had probably already
mentioned about it.
Eclipse does not recognize that Glassfish is running.
The status on the server view says "Stopped" rather than "Started".
What's wrong?

Thanks again,
Anna
Re: Eclipse and Glassfish [message #226572 is a reply to message #226546] Tue, 13 January 2009 13:14 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1298
Registered: July 2009
Senior Member
Hi Anna,

The feature of being able to "adopt" a running server is something that
is up to the server adapter to implement. Currently, none of the
server adapters built into WTP support this feature. It would appear
that neither does the Glassfish server adapter. As for whether it will
be supported in the future, you would need to ask the Glassfish adapter
developers on a Glassfish newsgroup or forum.

The main reason this feature is not typically supported is that what can
be done with a process that Eclipse starts, such as a server, is quite
different from what Eclipse can do with a process started outside of
Eclipse. Making a server started within Eclipse behave the same as an
already running server that gets "adopted" is potentially very
difficult. For example, the server's console output is easy to
"connect" to the Console view when started within Eclipse, but
difficult, if not impossible or impractical, when "adopted".

Also, while determining certain ports are in use may suggest a
particular server is running, it's not guaranteed that those ports are
being used by that particular server. In certain development
environments, perhaps such as yours, it may be reasonable to assume that
a certain ports being in use correctly implies a particular server is
running. However, it may not be reasonable for Eclipse to assume this
in general.

So, unless the Glassfish documentation says otherwise, it would appear
the "Stopped" and "Started" status refers only to the a Glassfish server
started within Eclipse. Related to this, I recall that there were some
posts on this list a number of months ago about an issue with the
Glassfish server adapter. When you shut down Eclipse or switched
workspaces, the Glassfish server would be left running if it had been
started in that Eclipse session. This would create the same
inconvenience of having to stop the server outside of Eclipse so it
could be restarted within Eclipse. I don't know the current status of
this problem.

Cheers,
Larry

Anna wrote:
> David and Kevin, thank you so much!
>
> Would you please help me to solve my other problem, I had probably
> already mentioned about it.
> Eclipse does not recognize that Glassfish is running.
> The status on the server view says "Stopped" rather than "Started".
> What's wrong?
>
> Thanks again,
> Anna
>
>
>
>
Re: Eclipse and Glassfish [message #226579 is a reply to message #226378] Tue, 13 January 2009 15:25 Go to previous messageGo to next message
Eclipse User
Originally posted by: Kevin.REMOVE.Dean.datadevelopment.com

David Carver wrote:

>Two different use cases.

Really? I need a WAR file in my development environment so that I can
develop and test my code. This WAR file is automatically built by Eclipse
and contains my static objects (HTML, JPG, etc.), my dynamic objects
(JSP), my compiled classes, and any and all supporting libraries.

To deploy the application to production, I need a WAR file that contains
my static objects (HTML, JPG, etc.), my dynamic objects (JSP), my compiled
classes, and any and all supporting libraries.

The differences between the development WAR and the production WAR are
few; generally, a few tweaks in web.xml are all that's required and those
are easily accomplished by ANT and XSL. In my pre-Eclipse JBuilder days,
I could build full enterprise applications with JBuilder by using all the
GUI build management tools that JBuilder provided. I could then take the
output of JBuilder and run an ANT script whose SOLE responsibility was to
apply production configuration changes and deploy the artifact to the
production server.

The Eclipse approach is to ask me to do all the work I use an IDE to get
away from in the first place.

--
Re: Eclipse and Glassfish [message #226592 is a reply to message #226579] Wed, 14 January 2009 03:24 Go to previous messageGo to next message
Eclipse User
Originally posted by: mauro.molinari.cardinis.com

Kevin Dean ha scritto:
> Really? I need a WAR file in my development environment so that I can
> develop and test my code. This WAR file is automatically built by
> Eclipse and contains my static objects (HTML, JPG, etc.), my dynamic
> objects (JSP), my compiled classes, and any and all supporting libraries.

Why do you need a WAR to develop and test your code?

This is what I do to develop and test my code, afer installing WTP,
Tomcat and configuring WTP to use Tomcat:
- create my project, with my source and web resources and develop on it
- start Tomcat from Eclipse, either in standard or in debug mode
- connect to localhost:8080 with a web browser to test my code

I think with Glassfish it is the same as with Tomcat.
It seems quite automated to me...

Mauro.
Re: Eclipse and Glassfish [message #226598 is a reply to message #226592] Wed, 14 January 2009 08:50 Go to previous messageGo to next message
Eclipse User
Originally posted by: Kevin.REMOVE.Dean.datadevelopment.com

Mauro Molinari wrote:

>Why do you need a WAR to develop and test your code?

Alright, let me put it another way...

Eclipse has the intelligence to deploy my web application in its entirety.
In one extra step, it could put the WAR file that it builds (and it does build a WAR file, at least for Glassfish deployment) into an accessible location that I could then use as the basis for my production deployment.

The point of an IDE is to save time. If the IDE allows you to be
productive in coding but still requires significant manual effort to turn
that code into a production deployable artifact, then the IDE is not doing
its job.

Visual Studio, for example, allows me to build debug and release versions
of my application in parallel. It also allows me to create a setup file
for my application. All of this is controlled through an
easy-to-understand GUI, not through arcane make files or Ant scripts. It
took a while for Microsoft to get to this point, but I'm far more
productive in Windows development than I have ever been because I can
focus on coding and debugging, not on building production artifacts.

JBuilder, until it became Eclipse-based, used to do the same. I could
build and sign JAR files. I could build any Java Enterprise artifact. It
was all done automatically for me. I am measurably less productive in
Eclipse because it stops short of developing the final artifacts I need
for my projects.

Of course, if this weren't a real requirement, people wouldn't keep asking
questions like "where does Eclipse put .WAR file that it creates when
building a web application?"

--
Re: Eclipse and Glassfish [message #226604 is a reply to message #226598] Wed, 14 January 2009 10:10 Go to previous messageGo to next message
Eclipse User
Originally posted by: dcarver.starstandard.org

Kevin Dean wrote:

> Of course, if this weren't a real requirement, people wouldn't keep
> asking questions like "where does Eclipse put .WAR file that it creates
> when building a web application?"

One thing to keep in mind, is that eclipse is not a full featured
application for enterprise development. It is really a set of
frameworks for enabling adopters of the framework to build and extend
the base functionality. Even though eclipse is a very good IDE it does
leave some stuff to the adopters to implement (i.e. the IBMs, CodeGears,
and Oracles of the world).

With that said, the way you are using eclipse and developing doesn't
necessarily meet with how others are using and developing. There are
different approaches. So if you need the particular functionality,
open an enhancement request to have it added. The use case just might
not have been thought of.

Typically I've seen the building of production deployable WARs handled
by a release engineering team, and not handled directly from within the
IDE. PDE comes the closest to this, but even for large scale
implementations they still recommend a batch build and deployment
process so that pragmatic release engineering can be done outside of
eclipse and not dependent on eclipse.

Dave
Re: Eclipse and Glassfish [message #226709 is a reply to message #226598] Thu, 15 January 2009 03:49 Go to previous messageGo to next message
Eclipse User
Originally posted by: mauro.molinari.cardinis.com

Kevin Dean ha scritto:
> Of course, if this weren't a real requirement, people wouldn't keep
> asking questions like "where does Eclipse put .WAR file that it creates
> when building a web application?"

Well, I personally think that the WAR Eclipse produces would hardly be
suitable for the production deployment. For instance, the compiler
settings I use in Eclipse are quite different from the compilation
settings we are using to build the packages for production deployment
(we even use another compiler, Sun's javac vs Eclipse JDT...).
Moreover, in the building phase of the packages for production
deployment we need to do many other extra things that are not just
"packaging classes in a WAR", like creating other artifacts needed in
the production build and not in the development build. To complete all
the steps, a deployment and test system (like Hudson, for instance) is
much more adeguate than simply an IDE (like Eclipse).

It depends a lot on your requirements. If you simply need a WAR, then
use Export => WAR. That doesn't sound so much "manual" to me...

Anyway, as David said, you can always open an enhancement request.

Mauro.
Re: Eclipse and Glassfish [message #226732 is a reply to message #226709] Thu, 15 January 2009 09:52 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3125
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Mauro Molinari wrote:
> Kevin Dean ha scritto:
>> Of course, if this weren't a real requirement, people wouldn't keep
>> asking questions like "where does Eclipse put .WAR file that it
>> creates when building a web application?"
>
> Well, I personally think that the WAR Eclipse produces would hardly be
> suitable for the production deployment. For instance, the compiler
> settings I use in Eclipse are quite different from the compilation
> settings we are using to build the packages for production deployment
> (we even use another compiler, Sun's javac vs Eclipse JDT...).
> Moreover, in the building phase of the packages for production
> deployment we need to do many other extra things that are not just
> "packaging classes in a WAR", like creating other artifacts needed in
> the production build and not in the development build. To complete all
> the steps, a deployment and test system (like Hudson, for instance) is
> much more adeguate than simply an IDE (like Eclipse).
>
> It depends a lot on your requirements. If you simply need a WAR, then
> use Export => WAR. That doesn't sound so much "manual" to me...
>
> Anyway, as David said, you can always open an enhancement request.
>
> Mauro.

I find it even more odd that there would be the slightest dissent on
this point than that Eclipse doesn't already directly support
deployment. There simply aren't other products playing this role that do
not assume responsibility for the whole enchilada.

Take autotools, for instance. No one on Unix/Linux would even think
about writing separate deployment scripts for building products because
that would be too much work when autotools (autoconf, automake, autolib,
etc.) are perfectly suited for gathering exactly what is needed and are
perfectly suited for tailoring their output to development, testing or
production deployment (and other targets as well). It never crossed the
minds of the authors that autotools wouldn't do everything needful.

Elsewhere in this thread, you've heard it pointed out that Visual Studio
does it all. Cradle to grave. This is because its authors could not
possibly conceive of not doing everything developers need. You can say
what you want about Microsoft (ugh!), but they have a vested interest in
developers developing product for their platform and they come through.

Eclipse is like a big garage full of tools and a lot of cool and
interesting junk piled around on tables, in corners, hanging from the
ceiling, etc. It's as difficult for someone new to go in and set up a
productive Eclipse environment as it is to learn Java, or
object-oriented programming concepts, servlet programming, etc. and it
shouldn't be. Those latter things should be the only hard stuff we have
to learn how to do. The hard parts for developers should be
accomplishing the tasks in their software and writing good code in their
respective programming languages--and not having to spend time needing
to become a guru of their development environment.

Without forums such as this one (and it takes a dozen or so forums to
corral just Eclipse, not to mention maven, ant and other aspects of
deployment), Eclipse wouldn't hardly be useful at all. And that's just
plain wrong.

I think we could (and should) take a lesson from Microsoft in this vein.
I thank my lucky stars that I've got others on my team and am working on
an existing product. Otherwise, I'd probably have to spend all my time
making Eclipse work instead of thinking about the real issues I have to
solve. The issues of a product that puts bread in my children's mouth.
Knowing "how to" in Eclipse doesn't do that.

I suspect this topic is self-defeating, however. If I were developing
Eclipse plug-ins, I'd be more interested in developing something cool
and interesting than solving the difficulties of deployment, so I don't
blame the process. I'm thankful that there is an Eclipse because I know
the alternative (having written C and Makefiles and used many dull
debuggers for nearly 30 years). I just wish I had the brains and the
leisure to fix the deployment problem.

There is always NetBeans which walks part of the way down this road
(pretty good maven integration)...
</rant>

Russ Bateman
Re: Eclipse and Glassfish [message #226773 is a reply to message #226250] Thu, 15 January 2009 14:12 Go to previous messageGo to next message
Eric Bresie is currently offline Eric Bresie
Messages: 44
Registered: July 2009
Member
Regarding startup issue:

Kevin Dean wrote:
> Anna wrote:
>>The Eclipse does not recognize that Glassfish server is already running
>>and tries to start it whenever I attempt to deploy an application.
>>Obviously the message immediately comes upt: "The server is already
>>running".
>>
>>I tried to start the server from both inside and outside the Eclipse, and
>>still the same result - the status of the server on the Eclipse server
>>view is shown as "stopped".
>>
>>What's wrong with my settings?

> The server must be started only from within Eclipse. If you are indeed
> doing so, check the Console window for any error messages on startup that
> would indicate why Eclipse is losing the connection to Glassfish.

Not sure if this is the case with you, however previously when trying to
startup Glassfish, I found that it was taking longer to start initally
than anticipated. It eventually started, but had similar behavior
(Eclipse said it was not started even though it was). As a work around, I
open the properties for the server (click on the server instance in the
Servers view), then change the Timeouts settings to more accurately
reflect start and stop time. For mine I had them set to about 260 but
this might be different on other configurations.

----

Regarding deployment issue:

>>One more thing I would like to ask:
>>where does Eclipse put .WAR file that it creates when building a web
>>application?
>>

> One of the many aggravating features of Eclipse is that it doesn't really
> build WAR or EAR files except as temporary artifacts. This makes it very
> difficult to build production files because you usually don't have access
> to the production server from your development environment. The only
> marginally useful suggestion I have ever had for this is to pick up the
> WAR file from the Glassfish domain applications directory.


In the Server properties once again, you can set the Domain Directory
(C:/glassfishv2ur2-b04/domains) and the Domin Name (Domain1).

There is a "Publishing" setting which allows you to publish when resources
change. By default it is set to "Never publish automatically"


From the Server view, you can select the server instance and "Publish" to
deploy.

Hope this helps some..

Eric
Re: Eclipse and Glassfish [message #226779 is a reply to message #226732] Thu, 15 January 2009 15:20 Go to previous message
Jesse McConnell is currently offline Jesse McConnell
Messages: 11
Registered: July 2009
Junior Member
In article <gknija$req$1@build.eclipse.org>,
Windofkeltia <russ@windofkeltia.com> wrote:

> production

Windows also has a vested interest in locking developers into specific
implementations, tooling, environments, etc. Windows has done a
wonderful job of _locking_ down the options available to people in terms
of application deployment. Yet the idea of people deploying to
production on their windows machines is not quite the cradle to grave
wonderland implied except for small shops or larger shops that have yet
to be bitten. Not so with things like maven, that tries its best to
build software based on tried and true conventions of developing
software, ant + ivy fit in here too. But then even maven acknowledges
that the world of production enterprise application development has far
more 'solutions' for deploying production artifacts then it cares to
address, so it doesn't. There are a couple of plugins that solve it for
niches here and there, but since there are no open standards for that,
its not specifically addressed past simple artifact deployment.

It ends up going for the artifact oriented approach where software
artifacts are produced and deployed someplace, creating an effective
interface between whatever tooling production deployment solutions might
want to put into place. staging, pre-production, testing, countless
different environments exist for making code live.

I figure that someday if the open source developer community, either
within or external to maven or eclipse have a big enough itch to scratch
there will start to be some full fledged open platforms for application
deployment built up and then eclipse could easily build tooling around
those conventions, etc. But until there is some element of open
standards in that area I wouldn't expect too much automagic workings on
things like eclipse. Outside of one off custom solutions of course.

cheers
jesse
Previous Topic:Docbook XML Transformation JAXPSAXProcessorInvoker XPath error
Next Topic:DSE SQL execution causes "Method can be called only once" error
Goto Forum:
  


Current Time: Fri Jul 25 09:42:53 EDT 2014

Powered by FUDForum. Page generated in 0.14137 seconds