Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Same EE/JPA project - Multiple Appservers
Same EE/JPA project - Multiple Appservers [message #227583] Tue, 10 February 2009 19:00 Go to next message
Eclipse UserFriend
Originally posted by: natgross.ATgmail.com

In 3.4 wtp, I have EE/JPA projects that I would like to deploy to
multiple appservers, AND run them from a fat (non web) client.
The question on the server project is: Which server-runtime library do I
use?
And on the client project, in the same source, I do a different init of
the Context (and jndi lookup) based on user's choice of server to connect
to. (Basically we want to test our server app on many servers from the
same client.) Is it ok to include all server vendors' client libs in the
same project?

Thanks nat
Re: Same EE/JPA project - Multiple Appservers [message #227599 is a reply to message #227583] Tue, 10 February 2009 20:43 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
> Is it ok to include all server vendors' client libs in the same project?

I would definitely not do this for either the server or the client part of
your app. If you want to write portable code, you will need to get a hold
of standard Java EE spec interfaces from Sun. Then you want to setup a
server runtime definition around those libraries. You do this by selecting
Basic/J2EE Runtime Library option in the new server runtime wizard. After
that, go ahead and define runtimes for other servers that you want to
support as well. In your projects, go to project properties and find the
Targeted Runtimes page. Select the spec runtime and all the other server
runtimes. Make sure to make the spec runtime the primary runtime (there is
a little target decoration icon that shows which runtime is the primary).
The primary runtime controls the libraries that your project sees, while
the functionality that's available for use on the project (as manifested
by facets) is going to be constrained as an intersection of capabilities
of all the runtimes that you select. This is the recommended way to
configure your projects if you intend to develop cross-platform
applications.
Re: Same EE/JPA project - Multiple Appservers [message #227611 is a reply to message #227599] Tue, 10 February 2009 22:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: natgross.ATgmail.com

On Tue, 10 Feb 2009 20:43:29 +0000, Konstantin Komissarchik wrote:

>> Is it ok to include all server vendors' client libs in the same
>> project?
>
> I would definitely not do this for either the server or the client part
> of your app. If you want to write portable code, you will need to get a
> hold of standard Java EE spec interfaces from Sun. Then you want to
> setup a server runtime definition around those libraries. You do this by
> selecting Basic/J2EE Runtime Library option in the new server runtime
> wizard. After that, go ahead and define runtimes for other servers that
> you want to support as well. In your projects, go to project properties
> and find the Targeted Runtimes page. Select the spec runtime and all the
> other server runtimes. Make sure to make the spec runtime the primary
> runtime (there is a little target decoration icon that shows which
> runtime is the primary). The primary runtime controls the libraries that
> your project sees, while the functionality that's available for use on
> the project (as manifested by facets) is going to be constrained as an
> intersection of capabilities of all the runtimes that you select. This
> is the recommended way to configure your projects if you intend to
> develop cross-platform applications.

Sounds simple enough on the server side. Thanks.
Question: Can I just define the basic/j2ee runtime (hopefully it's also
JEE 5) and not the other server's runtime and still deploy to multiple
servers?
Re: Same EE/JPA project - Multiple Appservers [message #227618 is a reply to message #227599] Tue, 10 February 2009 22:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: natgross.ATgmail.com

Woops. I just tried adding a ejb 3.0 project to the basic runtime and it
told me that it does not support it. But I think that I should not have a
problem using any runtime that I want to use as a defacto (maybe
Glassfish or Geronimo) standard.
In other words, now that I know that I can specify a primary runtime, and
the project sees only that, I need not worry even if I deploy that
project to multiple servers.

Thanks,
nat
Re: Same EE/JPA project - Multiple Appservers [message #227625 is a reply to message #227611] Wed, 11 February 2009 00:02 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
> Question: Can I just define the basic/j2ee runtime (hopefully it's also
> JEE 5) and not the other server's runtime and still deploy to multiple
> servers?

Yeah, that will work as well, you just loose the checks for actual
capabilities of all the servers involved. So for instance if one of your
target servers happened to be a j2ee 1.4 server, you might not find out
until you go to run the app that you can't be writing at java ee 5 level.
Re: Same EE/JPA project - Multiple Appservers [message #227630 is a reply to message #227625] Wed, 11 February 2009 00:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: natgross.ATgmail.com

On Wed, 11 Feb 2009 00:02:33 +0000, Konstantin Komissarchik wrote:

>> Question: Can I just define the basic/j2ee runtime (hopefully it's also
>> JEE 5) and not the other server's runtime and still deploy to multiple
>> servers?
>
> Yeah, that will work as well, ...

This is great! I am not worried about the checks, because in reality you
don't know if it works until actually running it anyhow.

Thanks.
nat
Re: Same EE/JPA project - Multiple Appservers [message #227637 is a reply to message #227618] Wed, 11 February 2009 00:08 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
> Woops. I just tried adding a ejb 3.0 project to the basic runtime and it
> told me that it does not support it.

Hmm... This sounds like a bug. Could you open a bug report at
https://bugs.eclipse.org/bugs/ with relevant details?

> But I think that I should not have a
> problem using any runtime that I want to use as a defacto (maybe
> Glassfish or Geronimo) standard.
> In other words, now that I know that I can specify a primary runtime, and
> the project sees only that, I need not worry even if I deploy that
> project to multiple servers.

Yeah, people do that fairly typically, especially since you will need at
least one server installed locally for testing purposes. The danger is
that you can accidentally use a class that's not part of the standard, but
you can just keep an eye out for that.
Re: Same EE/JPA project - Multiple Appservers [message #227644 is a reply to message #227637] Wed, 11 February 2009 00:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: natgross.ATgmail.com

On Wed, 11 Feb 2009 00:08:31 +0000, Konstantin Komissarchik wrote:

>> Woops. I just tried adding a ejb 3.0 project to the basic runtime and
>> it told me that it does not support it.
>
> Hmm... This sounds like a bug. Could you open a bug report at
> https://bugs.eclipse.org/bugs/ with relevant details?

Shall do.
Thanks
nat
Re: Same EE/JPA project - Multiple Appservers [message #227673 is a reply to message #227637] Wed, 11 February 2009 18:06 Go to previous message
Eclipse UserFriend
Originally posted by: natgross.ATgmail.com

On Wed, 11 Feb 2009 00:08:31 +0000, Konstantin Komissarchik wrote:

>> Woops. I just tried adding a ejb 3.0 project to the basic runtime and
>> it told me that it does not support it.
>
> Hmm... This sounds like a bug. Could you open a bug report at
> https://bugs.eclipse.org/bugs/ with relevant details?

Bug 264559 Submitted.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=264559

nat
Previous Topic:Resource Not Available
Next Topic:WS-I validator dependent on plugin runtime?
Goto Forum:
  


Current Time: Tue Mar 19 07:33:18 GMT 2024

Powered by FUDForum. Page generated in 0.02650 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top