How to add a .war to a CASA without netbeans?

12 messages Options
Embed this post
Permalink
Jim Whiteley

How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
I have a .war file built outside of the netbeans environment.  This
.war has WS Consumers, which need to access WS Providers in another
.war (which is built in the NB environment) through the NMR.  I would
like to make them both part of the same service assembly.

How is this accomplished?  The "Add JBI Module" dialog in NB seems to
be strictly project-based.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Jim Whiteley

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
No response to this.  Does that mean it can't (easily) be done?

On Thu, Oct 15, 2009 at 5:43 PM, Jim Whiteley <[hidden email]> wrote:
> I have a .war file built outside of the netbeans environment.  This
> .war has WS Consumers, which need to access WS Providers in another
> .war (which is built in the NB environment) through the NMR.  I would
> like to make them both part of the same service assembly.
>
> How is this accomplished?  The "Add JBI Module" dialog in NB seems to
> be strictly project-based.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Andreas Egloff

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
CompApp folks would be better to answer, I don't think though that this
is directly a feature in the composite app project; there should be ways
to achieve what you're looking for though.

Besides starting to modify the build scripts one way (which I don't know
if acceptable and I have not tried) might be to have your war packaged
into an ear; e.g. create and add a "Java EE/Enterprise Application", in
project properties add "JAR/Folder" and remove what's not needed. Or you
could add a "Java EE/packaged archive" which point to your war to the
enterprise app.

Jim Whiteley wrote:

> No response to this.  Does that mean it can't (easily) be done?
>
> On Thu, Oct 15, 2009 at 5:43 PM, Jim Whiteley <[hidden email]> wrote:
>  
>> I have a .war file built outside of the netbeans environment.  This
>> .war has WS Consumers, which need to access WS Providers in another
>> .war (which is built in the NB environment) through the NMR.  I would
>> like to make them both part of the same service assembly.
>>
>> How is this accomplished?  The "Add JBI Module" dialog in NB seems to
>> be strictly project-based.
>>
>>    
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Jun Qian

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
Currently, the JBI Modules in CompApp/CASA are strictly NetBeans project
based. I think Andi's suggestion should work although I haven't tried it.

This looks like a good enhancement to CompApp. I have filed
http://www.netbeans.org/issues/show_bug.cgi?id=175327

Thanks,
Jun

Andreas Egloff wrote:

> CompApp folks would be better to answer, I don't think though that
> this is directly a feature in the composite app project; there should
> be ways to achieve what you're looking for though.
>
> Besides starting to modify the build scripts one way (which I don't
> know if acceptable and I have not tried) might be to have your war
> packaged into an ear; e.g. create and add a "Java EE/Enterprise
> Application", in project properties add "JAR/Folder" and remove what's
> not needed. Or you could add a "Java EE/packaged archive" which point
> to your war to the enterprise app.
>
> Jim Whiteley wrote:
>> No response to this.  Does that mean it can't (easily) be done?
>>
>> On Thu, Oct 15, 2009 at 5:43 PM, Jim Whiteley <[hidden email]>
>> wrote:
>>  
>>> I have a .war file built outside of the netbeans environment.  This
>>> .war has WS Consumers, which need to access WS Providers in another
>>> .war (which is built in the NB environment) through the NMR.  I would
>>> like to make them both part of the same service assembly.
>>>
>>> How is this accomplished?  The "Add JBI Module" dialog in NB seems to
>>> be strictly project-based.
>>>
>>>    
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>  
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


--

Jun Qian

NetBeans SOA Tools, http://enterprise.netbeans.org
Open ESB Community, http://open-esb.org


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Jim Whiteley

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Andreas Egloff
On Fri, Oct 23, 2009 at 11:01 AM, Andreas Egloff <[hidden email]> wrote:
> Besides starting to modify the build scripts one way (which I don't know if
> acceptable and I have not tried) might be to have your war packaged into an
> ear; e.g. create and add a "Java EE/Enterprise Application", in project
> properties add "JAR/Folder" and remove what's not needed.

This almost works.  I'm able to add the .ear to the CASA, and deploy
it, but when my WS consumer tries to make a call, I get either
ThreadDeath exceptions, or "NoClassDefFoundError: Could not initialize
class com.sun.xml.ws.fault.SOAPFaultBuilder".

> Or you could add a
> "Java EE/packaged archive" which point to your war to the enterprise app.

This does not work.  For some reason, I'm unable to drag such a
project to the CASA canvas.  I also tried a "Java Web/Web Free-Form
Application", with a build.xml that just copies over the external
.war.  I'm also unable to add this project to the service assembly.

In the Add JBI Module dialog, how does the "Project JAR Files:" list
get populated?  In case of "Java EE/packaged archive" or "Java Web/Web
Free-Form Application", this list is empty, even if I have a .war
under dist/  .

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Jim Whiteley

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
On Mon, Oct 26, 2009 at 3:28 PM, Jim Whiteley <[hidden email]> wrote:

> On Fri, Oct 23, 2009 at 11:01 AM, Andreas Egloff <[hidden email]> wrote:
>> Besides starting to modify the build scripts one way (which I don't know if
>> acceptable and I have not tried) might be to have your war packaged into an
>> ear; e.g. create and add a "Java EE/Enterprise Application", in project
>> properties add "JAR/Folder" and remove what's not needed.
>
> This almost works.  I'm able to add the .ear to the CASA, and deploy
> it, but when my WS consumer tries to make a call, I get either
> ThreadDeath exceptions, or "NoClassDefFoundError: Could not initialize
> class com.sun.xml.ws.fault.SOAPFaultBuilder".
>

This appears to be a bug.  I've got two NB projects, one with the WS
provider, and the other with the WS Consumer.  I put them both in a
service assembly, and it works: the WS consumer calls into the WS
provider through the NMR.

As a proof of concept, I take the .war produced by the WS consumer
project, and treat it as "external" -- as though it didn't come from
an external project.  I create a new Enterprise Application as
described above, and add the WS consumer .war to this project.  I then
create a new service assembly containing the WS provider NB project,
and this Enterprise Application containing the "external" .war.  When
I deploy it, I see a couple of problems:

When restarting glassfish, although the admin console says it is
deployed and started, I can't hit my servlet that is part of the WS
consumer .war (server returns 404).

If I undeploy the service assembly, and redeploy it, I no longer get
the 404.  Instead, I get a ThreadDeath exception the first time the WS
Consumer is invoked.  Each time thereafter I get
"NoClassDefFoundError: Could not initialize class
com.sun.xml.ws.fault.SOAPFaultBuilder."  I believe these subsequent
errors are a result of the first ThreadDeath error [1].

Keep in mind that this is the same .war that works if I build the
service assembly out of two NB projects directly, instead of the
enterprise app wrapper project.

[1] http://wiki.glassfish.java.net/Wiki.jsp?page=FaqWebAppStoppedIllegalAccessError

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Andreas Egloff

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
Thanks for the investigation.

Venkat, do you want this filed as a bug against JavaEE SE?

Jim Whiteley wrote:

> On Mon, Oct 26, 2009 at 3:28 PM, Jim Whiteley <[hidden email]> wrote:
>  
>> On Fri, Oct 23, 2009 at 11:01 AM, Andreas Egloff <[hidden email]> wrote:
>>    
>>> Besides starting to modify the build scripts one way (which I don't know if
>>> acceptable and I have not tried) might be to have your war packaged into an
>>> ear; e.g. create and add a "Java EE/Enterprise Application", in project
>>> properties add "JAR/Folder" and remove what's not needed.
>>>      
>> This almost works.  I'm able to add the .ear to the CASA, and deploy
>> it, but when my WS consumer tries to make a call, I get either
>> ThreadDeath exceptions, or "NoClassDefFoundError: Could not initialize
>> class com.sun.xml.ws.fault.SOAPFaultBuilder".
>>
>>    
>
> This appears to be a bug.  I've got two NB projects, one with the WS
> provider, and the other with the WS Consumer.  I put them both in a
> service assembly, and it works: the WS consumer calls into the WS
> provider through the NMR.
>
> As a proof of concept, I take the .war produced by the WS consumer
> project, and treat it as "external" -- as though it didn't come from
> an external project.  I create a new Enterprise Application as
> described above, and add the WS consumer .war to this project.  I then
> create a new service assembly containing the WS provider NB project,
> and this Enterprise Application containing the "external" .war.  When
> I deploy it, I see a couple of problems:
>
> When restarting glassfish, although the admin console says it is
> deployed and started, I can't hit my servlet that is part of the WS
> consumer .war (server returns 404).
>
> If I undeploy the service assembly, and redeploy it, I no longer get
> the 404.  Instead, I get a ThreadDeath exception the first time the WS
> Consumer is invoked.  Each time thereafter I get
> "NoClassDefFoundError: Could not initialize class
> com.sun.xml.ws.fault.SOAPFaultBuilder."  I believe these subsequent
> errors are a result of the first ThreadDeath error [1].
>
> Keep in mind that this is the same .war that works if I build the
> service assembly out of two NB projects directly, instead of the
> enterprise app wrapper project.
>
> [1] http://wiki.glassfish.java.net/Wiki.jsp?page=FaqWebAppStoppedIllegalAccessError
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Andreas Egloff

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jim Whiteley
Jim Whiteley wrote:

> On Fri, Oct 23, 2009 at 11:01 AM, Andreas Egloff <[hidden email]> wrote:
>  
>> Besides starting to modify the build scripts one way (which I don't know if
>> acceptable and I have not tried) might be to have your war packaged into an
>> ear; e.g. create and add a "Java EE/Enterprise Application", in project
>> properties add "JAR/Folder" and remove what's not needed.
>>    
>
> This almost works.  I'm able to add the .ear to the CASA, and deploy
> it, but when my WS consumer tries to make a call, I get either
> ThreadDeath exceptions, or "NoClassDefFoundError: Could not initialize
> class com.sun.xml.ws.fault.SOAPFaultBuilder".
>
>  
>> Or you could add a
>> "Java EE/packaged archive" which point to your war to the enterprise app.
>>    
>
> This does not work.  For some reason, I'm unable to drag such a
> project to the CASA canvas.
I didn't mean to imply that you could directly add it to CompApp, but as
an alternative to adding the war to the enterprise app (ear) project. It
really only makes sense if you need to modify descriptors or the like
for the (re)packaging, so likely it will not help your current issues.

>   I also tried a "Java Web/Web Free-Form
> Application", with a build.xml that just copies over the external
> .war.  I'm also unable to add this project to the service assembly.
>
> In the Add JBI Module dialog, how does the "Project JAR Files:" list
> get populated?  In case of "Java EE/packaged archive" or "Java Web/Web
> Free-Form Application", this list is empty, even if I have a .war
> under dist/  .
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Jim Whiteley

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
On Tue, Oct 27, 2009 at 9:42 AM, Andreas Egloff <[hidden email]> wrote:

>>> Or you could add a
>>> "Java EE/packaged archive" which point to your war to the enterprise app.
>>>
>>
>> This does not work.  For some reason, I'm unable to drag such a
>> project to the CASA canvas.
>
> I didn't mean to imply that you could directly add it to CompApp, but as an
> alternative to adding the war to the enterprise app (ear) project. It really
> only makes sense if you need to modify descriptors or the like for the
> (re)packaging, so likely it will not help your current issues.

Now I'm not sure that I'm following you.  The idea is that I need to
wrap my "external" .war with some NB project, right?  One way to to
that is to create an Enterprise App project, and add the .war to that.
 Then I need to add the Enterprise App (containing my "external" .war)
to my service assembly.  This almost works, as discussed previously.

I interpreted your other suggestion to mean that another way of
wrapping my .war with an NB project was to use create a "Java
EE/packaged archive", and point it to my .war.  Then I would need to
add this new project (the Java EE/packaged archive) to a service
assembly.  Is this not what you meant?  I don't need to modify the
.war, I just need some way to have netbeans allow me to add the .war
to a service assembly.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Andreas Egloff

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
Jim Whiteley wrote:

> On Tue, Oct 27, 2009 at 9:42 AM, Andreas Egloff <[hidden email]> wrote:
>  
>>>> Or you could add a
>>>> "Java EE/packaged archive" which point to your war to the enterprise app.
>>>>
>>>>        
>>> This does not work.  For some reason, I'm unable to drag such a
>>> project to the CASA canvas.
>>>      
>> I didn't mean to imply that you could directly add it to CompApp, but as an
>> alternative to adding the war to the enterprise app (ear) project. It really
>> only makes sense if you need to modify descriptors or the like for the
>> (re)packaging, so likely it will not help your current issues.
>>    
>
> Now I'm not sure that I'm following you.  The idea is that I need to
> wrap my "external" .war with some NB project, right?  One way to to
> that is to create an Enterprise App project, and add the .war to that.
>  Then I need to add the Enterprise App (containing my "external" .war)
> to my service assembly.  This almost works, as discussed previously.
>
> I interpreted your other suggestion to mean that another way of
> wrapping my .war with an NB project was to use create a "Java
> EE/packaged archive", and point it to my .war.  Then I would need to
> add this new project (the Java EE/packaged archive) to a service
> assembly.  Is this not what you meant?  I don't need to modify the
> .war, I just need some way to have netbeans allow me to add the .war
> to a service assembly.
>  
The second way I mentioned was just a variation of adding the war to the
Enterprise App; rather than adding it as a library/path one can add it
to the Enterprise app as (yet another) project, the packaged archive. It
does not get around having the ear, for that composite app needs to be
enhanced as Jun mentioned.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Venkat Chellasamy

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Andreas Egloff
probably, but before filing, do we know that the the ear (with the
external war) works in glassfish when deployed directly (outside of comp
app)?


Andreas Egloff wrote:

> Thanks for the investigation.
>
> Venkat, do you want this filed as a bug against JavaEE SE?
>
> Jim Whiteley wrote:
>> On Mon, Oct 26, 2009 at 3:28 PM, Jim Whiteley <[hidden email]>
>> wrote:
>>  
>>> On Fri, Oct 23, 2009 at 11:01 AM, Andreas Egloff
>>> <[hidden email]> wrote:
>>>    
>>>> Besides starting to modify the build scripts one way (which I don't
>>>> know if
>>>> acceptable and I have not tried) might be to have your war packaged
>>>> into an
>>>> ear; e.g. create and add a "Java EE/Enterprise Application", in
>>>> project
>>>> properties add "JAR/Folder" and remove what's not needed.
>>>>      
>>> This almost works.  I'm able to add the .ear to the CASA, and deploy
>>> it, but when my WS consumer tries to make a call, I get either
>>> ThreadDeath exceptions, or "NoClassDefFoundError: Could not initialize
>>> class com.sun.xml.ws.fault.SOAPFaultBuilder".
>>>
>>>    
>>
>> This appears to be a bug.  I've got two NB projects, one with the WS
>> provider, and the other with the WS Consumer.  I put them both in a
>> service assembly, and it works: the WS consumer calls into the WS
>> provider through the NMR.
>>
>> As a proof of concept, I take the .war produced by the WS consumer
>> project, and treat it as "external" -- as though it didn't come from
>> an external project.  I create a new Enterprise Application as
>> described above, and add the WS consumer .war to this project.  I then
>> create a new service assembly containing the WS provider NB project,
>> and this Enterprise Application containing the "external" .war.  When
>> I deploy it, I see a couple of problems:
>>
>> When restarting glassfish, although the admin console says it is
>> deployed and started, I can't hit my servlet that is part of the WS
>> consumer .war (server returns 404).
>>
>> If I undeploy the service assembly, and redeploy it, I no longer get
>> the 404.  Instead, I get a ThreadDeath exception the first time the WS
>> Consumer is invoked.  Each time thereafter I get
>> "NoClassDefFoundError: Could not initialize class
>> com.sun.xml.ws.fault.SOAPFaultBuilder."  I believe these subsequent
>> errors are a result of the first ThreadDeath error [1].
>>
>> Keep in mind that this is the same .war that works if I build the
>> service assembly out of two NB projects directly, instead of the
>> enterprise app wrapper project.
>>
>> [1]
>> http://wiki.glassfish.java.net/Wiki.jsp?page=FaqWebAppStoppedIllegalAccessError 
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>  
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


--

Venkat Chellasamy
Sr Development Manager
Java CAPS/Open ESB Platform


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Girish Patil-2

Re: How to add a .war to a CASA without netbeans?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Ear as a Java EE Engine service unit is supported.  As far I know currently NB Ear project does not allow one to add archives (EJB jar or Web war) to it directly, one need to have Netbeans EJB or Web project before adding them.

Even if one created valid Ear and composed manually (or using tool other NB IDE) service assembly with valid service unit and service assembly jbi.xml, runtime should work.

May be this issue is related to GF issue #
6551 [1].
--Girish


[1] https://glassfish.dev.java.net/issues/show_bug.cgi?id=6551

Venkat Chellasamy wrote:
probably, but before filing, do we know that the the ear (with the external war) works in glassfish when deployed directly (outside of comp app)?


Andreas Egloff wrote:
Thanks for the investigation.

Venkat, do you want this filed as a bug against JavaEE SE?

Jim Whiteley wrote:
On Mon, Oct 26, 2009 at 3:28 PM, Jim Whiteley [hidden email] wrote:
 
On Fri, Oct 23, 2009 at 11:01 AM, Andreas Egloff [hidden email] wrote:
  
Besides starting to modify the build scripts one way (which I don't know if
acceptable and I have not tried) might be to have your war packaged into an
ear; e.g. create and add a "Java EE/Enterprise Application", in project
properties add "JAR/Folder" and remove what's not needed.
     
This almost works.  I'm able to add the .ear to the CASA, and deploy
it, but when my WS consumer tries to make a call, I get either
ThreadDeath exceptions, or "NoClassDefFoundError: Could not initialize
class com.sun.xml.ws.fault.SOAPFaultBuilder".

   

This appears to be a bug.  I've got two NB projects, one with the WS
provider, and the other with the WS Consumer.  I put them both in a
service assembly, and it works: the WS consumer calls into the WS
provider through the NMR.

As a proof of concept, I take the .war produced by the WS consumer
project, and treat it as "external" -- as though it didn't come from
an external project.  I create a new Enterprise Application as
described above, and add the WS consumer .war to this project.  I then
create a new service assembly containing the WS provider NB project,
and this Enterprise Application containing the "external" .war.  When
I deploy it, I see a couple of problems:

When restarting glassfish, although the admin console says it is
deployed and started, I can't hit my servlet that is part of the WS
consumer .war (server returns 404).

If I undeploy the service assembly, and redeploy it, I no longer get
the 404.  Instead, I get a ThreadDeath exception the first time the WS
Consumer is invoked.  Each time thereafter I get
"NoClassDefFoundError: Could not initialize class
com.sun.xml.ws.fault.SOAPFaultBuilder."  I believe these subsequent
errors are a result of the first ThreadDeath error [1].

Keep in mind that this is the same .war that works if I build the
service assembly out of two NB projects directly, instead of the
enterprise app wrapper project.

[1] http://wiki.glassfish.java.net/Wiki.jsp?page=FaqWebAppStoppedIllegalAccessError

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

 


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]