How do I upgrade from CDI1.0 to CDI 1.1 - eclipse

For Java EE project I use JBoss AS7.1 and Eclipse IDE. In Eclipse I can see the current version of CDI under: Project -> Properties -> ProjectFacets -> CDI
How do I change the version to CDI 1.1 ?

If you are prepared to upgrade your application server, then make the switch to WildFly 8 or higher (WildFly is the new name of JBoss AS). CDI 1.1 is part of the Java EE 7 spec, which is implemented in WildFly 8.*, GlassFish 4.*, et al. If you are not able to upgrade your application server, you might be able to drop a JAR of an implementation of CDI 1.1 into your build, but it would probably be better to upgrade to EE 7 if you can.

Related

Eclipse STS WildFly deployment - Target runtimes disabled

We have a java web application deployed in a Tomcat 9 container and running successfully. We wanted to change the application deployment to Wildfly 27 application server. The direct deployment of app.war used in tomcat container to WildFly standalone folder showed deployment as failed.
So we did the following to create a deployment war by building source from IDE by using JBoss tools.
-Installed WildFly 27
-Imported application source code in Spring Tool Suite (STS)
-Installed JBoss tools in STS
-Added WildFly server in STS. With no projects added, I can start the server successfully.
In Project Properties, I have the following configuration:
Properties -> Java Build Path
Here I removed the previously existing Server Runtime[Tomcat] and added WildFly 27.0 Runtime.
Properties -> Java Compiler
Properties -> Server
Properties -> Project Facets
In Runtimes tab, WildFly 27.0 Runtime is disabled.
Properties -> Targeted Runtimes
Here also, WildFly 27.0 Runtime is disabled. So I can’t change from Tomcat to WildFly.
How can I select WildFly 27.0 Runtime for the project? The instruction says to uninstall certain Facets to activate disabled runtimes. Which facets to uninstall?
When I started the WildFly server with the application, it shows errors
java.lang.IllegalArgumentException: UT010009:
class org.springframework.web.servlet.DispatcherServlet does not implement jakarta.servlet.Servlet
service jboss.deployment.unit."app.war".undertow-deployment.UndertowDeploymentInfoService: Failed to start service
Please help.
WildFly 27 is a Jakarta EE 10 server. You cannot run a Jakarta EE 8 based, javax namespace, in WildFly 27. You'd need to either upgrade your dependencies to be Jakarta EE 10 based and Spring 6 or use WildFly 26.

Spring 4 + hibernate & jpa 2.1 on weblogic 10.3.5

Will I be able to run Hibernate with JPA 2.1 on weblogic 10.3.5.
I have specified the below lines in weblogic-application.xml and packaged the jpa 2.1 API jar in the EAR along with other jars.
<wls:prefer-application-packages>
<wls:package-name>javax.persistence</wls:package-name>
</wls:prefer-application-packages>
Some how weblogic recognizes META-INF/persistence.xml and tries to automatically create persistence unit using Eclipse Link during application deployment/startup. This is where the weblogic classloader (parent of application class loader) is trying to load the persistence unit but failing with below exception.
java.lang.IllegalArgumentException: interface javax.persistence.EntityManagerFactory is not visible from class loader
Any help with this is very much appreciated.
Have you enabled JPA 2.1 on your Weblogic Instalation ?
If you refer to :
https://docs.oracle.com/cd/E17904_01/web.1111/e13720/using_toplink.htm#EJBAD1309
and
https://docs.oracle.com/middleware/1213/wls/EJBAD/using_toplink.htm#EJBAD1309
you will note that:
"Support for JPA 2.1 in WebLogic Server is provided as a patch because JPA 2.1 is part of the Java Platform, Enterprise Edition (Java EE) 7. Therefore, enabling JPA 2.1 support in the current release results in WebLogic Server not meeting all Java EE 6 compatibility requirements. To maintain Java EE 6 compatibility, the files required for JPA 2.1 support are not enabled by default, although they are included in a standard WebLogic Server installation."
Have a look #
How to Enable Java Persistence 2.0 for Weblogic 10.3.6
and
https://docs.oracle.com/cd/E17904_01/web.1111/e13720/using_toplink.htm#EJBAD1309

Migration JBoss EAP 4.2 from java 1.5 to java 1.8?

right now my app use 4.2 jboss with java 1.5.
I manage to build my app (EJB, jsf, hibernate, seam) with java 1.8, but i get some problems with running jboss 4.2 with java 1.8.
So I wonder, whether it is even possible or it will be better to switch to another version of jboss(with will be also complicate)?
Thank you for clarification.
So another question appear, if I use new jboss and java8 , Am I need to change hibernate (eg. I use hibernate-ejb 3.3.2ga), jsf, etc. to newer version? Application was build with java 8 with success.
You can't run JBoss EAP 4.2 on Java 1.8 (Or any other java newer than 1.6)
Use new version of JBoss EAP instead. This will give you better performance some cool new features and server will be easier to monitor and maintain.
Here is the link

JBoss AS vs WildFly 8

Can anyone please give me the main difference between JBoss AS 7 and WildFly 8?
I'm going to start a very important project and I have to choose between JBoss AS 7 and WildFly 8 (for this project I'm going to use GWT, JPA/Hibernate and jBPM 6).
WildFly 8 is the next iteration of the JBoss application server after JBoss AS 7 / EAP 6.
Basically:
JBoss AS 7.x = JEE6
JBoss EAP 6.x = JEE6
WildFly 8.x = JEE7
Red Hat typically backports security fixes from newer versions into older versions, Red Hat also typically releases "feature packs" that allow you to access newer features/specs.
So if it is a very important project and you do not need JEE7 specs, you may want to use JBoss EAP which is the productized version of JBoss AS 7.
Otherwise you may want to use WildFly if you need the more cutting edge specs and features.
Related
See JBoss AS / WildFly versions history for more details.
WildFly is the new name of JBoss AS so that the company JBoss and the application server JBoss cannot induce confusion anymore.
Think of WildFly 8 as JBoss AS 8, just with a different name.
JBoss 7 is an implementation of JavaEE 6.
WildFly 8 is an implementation of JavaEE 7.
The JBoss application server is the "commercialized" version of the community Wildfly application server. Red Hat offers support contracts for JBoss and has a long term maintenance schedule for JBoss.
The versions are also different. JBoss EAP 6 corresponds to Wildfly 7.

Problems deploying Java EE 6 application from netbeans to JBoss 6

I have a Java EE 6 application developed on Netbeans 7 and try to deploy it on a JBoss 6 instance. The application makes use of JAX-RS but I am not using any Jersey specific aspects, just standard JAX-RS features.
Deployments as a WAR fails because of some missing Jersey classes and deployment as an EAR fails due to org.jboss.deployers.spi.DeploymentException: Only one JAX-RS Application Class allowed
Any idea what the cause of this might be?
What I do not want to do is disable RESTEasy in JBoss, I'd rather produce an application that runs on any Java EE 6 container without tweaks.
Glassfish silently adds Jersey JAX-RS packages to the build. If you uncheck the 'Package' checkbox in the project's lib configuration, the application is packaged without Jersey.
This makes sense, because after all, the target of the deployment might be a non-Java EE 6 container such as Tomcat.