1

I have inherited a legacy EJB application that was built as an EJB 3.0 with session beans and JPA. I am migrating from WebSphere 8.0 where the application worked without issues. I have tested on WebSphere 8.5.5 classic and have no issues, however, we have decided for strategic reasons to use WebSphere Liberty. I am deploying two ear files on the application server, 1 which is a front end EAR app and one which houses the EJB (JPA) application. Both applications run ins the same JVM. I have deployed both and Liberty will start, however, I constantly (I know I can select the pop-up to save my choice) see the pop-up saying that my "Application XXXX requires feature(s): ejb-3.1 lite. However, I want to use ejb3.2-lite. In the project facets in Eclipse (Eclipse Juno w/ WDT) I cannot choose EJB 3.2 as the choice doesn't exist. The highest I can go is 3.1 which is the level currently. Here is the snippet of my server.xml file:

<server description="new server">

<!-- Enable features -->
<featureManager>
    <feature>javaee-7.0</feature>
    <feature>localConnector-1.0</feature>
    <feature>distributedMap-1.0</feature>
    <feature>adminCenter-1.0</feature> 
    <feature>ssl-1.0</feature>
    <feature>usr:webCacheMonitor-1.0</feature>
    <feature>webCache-1.0</feature>
    <feature>ldapRegistry-3.0</feature>
    <feature>ejbRemote-3.2</feature>
</featureManager>

<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint host="*" httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>

<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>
<applicationMonitor updateTrigger="mbean"/>
<enterpriseApplication id="CHServiceEAR" location="CHServiceEAR.ear" name="CHServiceEAR"/>
<enterpriseApplication id="CHNewCHRDMEAR" location="CHNewCHRDMEAR.ear" name="CHNewCHRDMEAR">
    <application-bnd>
       <security-role name="AllAuthenticated">
           <special-subject type="ALL_AUTHENTICATED_USERS" />
       </security-role>
   </application-bnd>
</enterpriseApplication>

In the Ear file java project I have selected EJB 3.1, but only because I don't see a way to select 3.2 as the EJB specification. Since you can see above I am using the full java7EE profile I am automatically getting ejblite-3.2 but it seems my app for some reason won't exploit it. Please advise!

Doug
  • 145
  • 2
  • 14
  • This is probably caused by the project facet in eclipse being configured for 3.1. If you right click on the project and select Project Facets there should be an ejb facet, if the version shows 3.1 then change it to 3.2 and it should work the way you want. – Alasdair Apr 05 '16 at 13:15
  • Yes, I should have mentioned (I'll add an update to the original post) that I updated the project facet from 3.0 to 3.1 but I cannot update to the 3.2 as the choice doesn't exist. I should also mention that in my JPA project I can't update from JPA 2.0 to 2.1 because the choice doesn't exist there either. Any thoughts? – Doug Apr 05 '16 at 13:59

1 Answers1

2

The WTP version in Eclipse Juno does not have JavaEE7 support. Try upgrading to Kepler and above - see the new and noteworthy section for further details https://www.eclipse.org/webtools/releases/3.5.0/NewAndNoteworthy/javaee.php

ktsao
  • 36
  • 2
  • Fair point, your right. I didn't even think of that. Arggg! We are stuck on this archaic eclipse version due to Rational Team Concert server constraints as well as other tooling my company utilizes. Do you happen to know if I can hack the xmls if I was desperate for EJB 3.2 and JPA 2.1? – Doug Apr 05 '16 at 17:58
  • I wouldn't recommend it. You can set up a workspace that supports JavaEE7 development (minimum level for WDT is Eclipse Luna) and try to install RTC on top of it. If you can't install RTC, then try to export your projects into an archive (Export > Archive File) and then import them in your new workspace so you can migrate and deploy them for testing. – ktsao Apr 05 '16 at 21:41
  • You can tell WDT not to add the features. If you right click on the project there is a preference section for Liberty features. It allows you to say not to add ejbLite-3.1 and then you can manually add ejbLite-3.2 to the server. – Alasdair Apr 06 '16 at 02:19
  • @ktsao -- Hacking xmls is probably a bad idea. :) I agree with your approach to export and import into a newer eclipse version. Thanks for then info. – Doug Apr 09 '16 at 00:44