This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 229465 - Cannot deploy Maven EAR to WebLogic
Summary: Cannot deploy Maven EAR to WebLogic
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7
: P1 normal (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-07 13:54 UTC by Jiri Skrivanek
Modified: 2013-05-28 14:14 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
WebLogic server log. (18.98 KB, text/plain)
2013-05-07 13:54 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2013-05-07 13:54:42 UTC
Created attachment 134189 [details]
WebLogic server log.

It is not possible to deploy Maven EAR project to WebLogic 12. To reproduce:

- create Maven Enterprise Application project (Java EE 6, WebLogic 12.1.1)
- add new session bean with business method to -ejb project
- build with dependencies covering project
- run -ear project but it fails

Deployment failed. The message was:   problem: cvc-complex-type.2.4c: Expected element 'module@http://java.sun.com/xml/ns/javaee' before the end of the content in element application@http://java.sun.com/xml/ns/javaee:<null>

Product Version: NetBeans IDE Dev (Build web-main-javaee7-290-on-20130507)
Java: 1.7.0_17; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Comment 1 Martin Janicek 2013-05-07 14:32:16 UTC
Thanks Jirko, I'll take a look at it at Thursday
Comment 2 Martin Janicek 2013-05-09 12:28:12 UTC
The problem lies in application.xml which is empty in Maven EAR project but obviously it need to contains some additional configuration:

For now the workarround is to manually update application.xml and put the following configuration inside the <application> open-close tags:

<display-name>SomeApplicationName</display-name>
<module>
    <web>
        <web-uri>NameOfTheWebModule-war.war</web-uri>
        <context-root>/ContextRootUsedInWebModule</context-root>
    </web>
</module>
<module>
    <ejb>NameOfTheEjbModule-ejb.jar</ejb>
</module>

..for the correct fix I'll need to reuse some code that is currently only in non-public j2ee.earproject module (specifically EarProjectGenerator.setupDD() method).

I'll investigate it further..
Comment 3 Martin Janicek 2013-05-13 12:30:20 UTC
Fixed in: web-main #a5d3d680a862
I guess this should be a 7.3.1 HR fix candidate ??
Comment 4 Petr Jiricka 2013-05-13 14:00:22 UTC
Yes it is - thanks a lot Martin.
Comment 5 Quality Engineering 2013-05-14 02:24:31 UTC
Integrated into 'main-golden', will be available in build *201305132300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a5d3d680a862
User: Martin Janicek <mjanicek@netbeans.org>
Log: #229465 - Cannot deploy Maven EAR to WebLogic
Comment 6 Jiri Skrivanek 2013-05-14 07:06:56 UTC
Verified in NetBeans IDE Dev (Build 201305132300).
Comment 7 Martin Janicek 2013-05-20 12:01:35 UTC
CCing to MartinF. May I ask you for peer code review?
Comment 8 Martin Fousek 2013-05-20 12:46:22 UTC
I'm really not an EAR expert, :) but as far as I saw the patch seems safe to me. 

There is place for possible NPE at "docBase.getFileObject(APPLICATION_XML);" but nothing what couldn't occur before too and which shouldn't happen for new projects. From my point of view free to integrate, patch is fine.
Comment 9 Martin Janicek 2013-05-20 15:58:31 UTC
Transplanted in: releases #abccacf64976
Comment 10 Quality Engineering 2013-05-21 00:21:17 UTC
Integrated into 'releases', will be available in build *201305202200* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/abccacf64976
User: Martin Janicek <mjanicek@netbeans.org>
Log: #229465 - Cannot deploy Maven EAR to WebLogic
(transplanted from a5d3d680a862dcfc45d8b3ba59937bf1d6f6a4a5)
Comment 11 Jiri Skrivanek 2013-05-21 08:30:39 UTC
In trunk it works, in 7.3.1 it doesn't. The difference between projects is that in trunk only weblogic-application.xml is created but in 7.3.1 there is also application.xml which causes problems.

Deployment failed. The message was:   problem: cvc-complex-type.2.4c: Expected element 'module@http://java.sun.com/xml/ns/javaee' before the end of the content in element application@http://java.sun.com/xml/ns/javaee:<null>
Comment 12 Martin Janicek 2013-05-27 11:43:59 UTC
I was unable to find out why the patch does not work in 7.3.1. Thus I have created and pushed another patch (web-main #d01bae271af4) which should be more reliable.

The previous patch were using EarModuleProviderImpl.getChildModuleProviders() for collecting sub-projects. But for some reason this solution worked randomly (in some cases J2eeModuleProviders of child projects weren't initialized during the creation and thus the application.xml was not created in the correct form).

Updated patch is using child project's directly from the wizard iterator (these should be always available) which I think will solve the problem.
Comment 13 Martin Janicek 2013-05-27 11:47:40 UTC
Jirko could you please verify it in trunk once the patch will be propagated? (hard to say if it will be anytime soon since the web-main isn't stable at the moment - alternatively I can send you maven.j2ee jar built with the patch)
Comment 14 Jiri Skrivanek 2013-05-27 13:24:49 UTC
Patch tested with 7.3.1 works for me.
Comment 15 Martin Janicek 2013-05-27 13:29:30 UTC
Thanks! I'm going to push the changes to the relases repository.
Comment 16 Martin Janicek 2013-05-27 13:33:41 UTC
Patch integrated in: releases #f4b5aa98dfed
Comment 17 Quality Engineering 2013-05-27 23:34:03 UTC
Integrated into 'releases', will be available in build *201305272201* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/f4b5aa98dfed
User: Martin Janicek <mjanicek@netbeans.org>
Log: #229465 - Cannot deploy Maven EAR to WebLogic
Comment 18 Quality Engineering 2013-05-28 14:14:41 UTC
Integrated into 'main-golden', will be available in build *201305281155* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d01bae271af4
User: Martin Janicek <mjanicek@netbeans.org>
Log: #229465 - Cannot deploy Maven EAR to WebLogic