migrating weblogic ejb 2.0 to jboss ejb 3.0 - jboss

We are using ejb 2.0, want to upgrade the code to ejb 3.1.
In my current code, lot of .java files are being automatically generated using xdoclet and ejbdoclet; I see reference to these xdoclet and ejbdoclets in my build.xml file. When I remove these xdoclet and ejbdoclet code from build.xml, the application does not compile any longer (using eclipse / ant ).
How do I make changes to xdoctlet templates or get rid of these xdoclet and ejbdoclet references?
What are the xdoclet / ejbdoclet templates look like? I don't want it to auto generate it at compile time.

Related

Eclipse Wildfly integration: Missing webapp resources on server

I'm building a java web application with Vaadin, which generates some config files on maven build. For some unknown reasons, only a part of the generated files in WEB-INF are present on the when trying to full publish to Wildfly in Eclipse. (In particular, WEB-INF/classes/META-INF/VAADIN/config/stats.json is not present which results in an error in the Vaadin application.)
Several things that were tested
Maven build does generate the file in the said location.
Copying the War built by maven directly to /standalone/deployments results in a working application without error.
After maven build and refresh in eclipse, the generated file is correctly shown in project explorer, indicating a successful refresh (right?)
Another generated file in the same directory DO get copied (flow-build-info.json). The difference between these two files may be, that flow-build-info.json exists twice in target, in classes/META-INF/VAADIN... as well as in /[final name]/WEB-INF/classes/META-INF..., while stats.json only exists in /[final name]/WEB-INF/classes/META-INF....
Used versions
Eclipse version: 21.12 & 21.9
JBoss AS, WildFly & EAP Server Tools: 3.9.106.v20210618-2025
Wildfly 17, 20, 22
Vaadin 14.7.5
I found out the problem: Maven build generates the Vaadin files just fine. However, if a maven update is executed afterwards in Eclipse before publishing to the server, the maven update would modify the target/classes directory. This modification somehow removes all files but the flow-build-info.json (still don't understand this part). This results in the missing resources after publishing.
So basically, maven build -> refresh in eclipse -> NO MAVEN UPDATE -> full publish works.

Spring Roo. Deleting .aj archives without generating new ones

I have installed the Roo Shell 2.0.0.RELEASE in my eclipse. I have never worked with Roo, but, as I understood, it will regenerate the .aj files of my imported roo project when I modify something in them.
However, when you open the projects, it just delete the .aj with commands like this:
roo> Deleted SRC_MAIN_JAVA\com\bbva\front\oorg\cirbe\cirbedaos\dto\vinculaciones\DetalleVinculacionesDaoOutDto_Roo_JavaBean.aj - not required for governor com.bbva.front.oorg.cirbe.cirbedaos.dto.vinculaciones.DetalleVinculacionesDaoOutDto
I don't know if I should write or configure something else, since most manuals I see only say that the Shell should generate these files automatically. Any idea about what im missing?
Indicate that I think the project used to work with shell 1.1.5 (i imported an existing project), but I was unable to open it, so I used 2.0.0. It is assumed that Roo has also updated this in the POM files:
Updated ROOT\pom.xml [updated property 'roo.version' to '2.0.0.RELEASE'; updated property 'roo.version' to '2.0.0.RELEASE']
Spring Roo uses the annotations included in your .java files to generate the .aj files. Each version of Spring Roo could provide/deprecate different annotations. Spring Roo 2.x is a major update, and it does not support some of the annotations of Spring Roo 1.x
https://docs.spring.io/spring-roo/docs/current/reference/html/#no-backward-compatibility
As you said, the project was created with the 1.x version of Spring Roo, so the generated code included annotations that are not supported by the 2.x version of Spring Roo. That is the reason because your .aj files are being removed with the message not required for governor.
Also, I guess that a warning message appeared to you in the Spring Roo shell before to open the project.
Hope it helps.

Could not find file ${libs.jsf20.classpath} to copy

I'm trying to build a web app in Netbeans. In project properties, I have four libraries - JSF2.2, MySQL JDBC Driver, PrimeFaces 5.0 and Java EE Web 7 API Library (all of them embedded in NetBeans, nothing was additionally downloaded). When I was creating the project, I selected JSF2.2 framework and Primefaces.
When I try to build (or clean and build) my project, I get the following error:
Warning: Could not find file E:\My Documents\NetBeansProjects\ConferenceManager\${libs.jsf20.classpath} to copy.
Any ideas?
Solved!
I removed the "default" library and included separate .jar fil that I had downloaded. That solved the problem with JSF, but then the same problem happened with MySQL connector (and I solved it the same way).

Make a deployable Java EE project from a java project

I have coded a small Java EE project that consists only of EJBs, helper classes and their tests.
The project is a maven project and creates a jar.
Right now, all tests are happening with JUnit and JMockit.
Now I want to deploy my application to a local glassfish 4.
What do I have to do, to deploy the project? I know that normaly a root Project with a root-Pom is created, that holds a EAR Project with the ear-Pom and the EJB Project with the ejb-jar.
I checked out the jee-simple-archetype, which was - for my kind of project - much to sophisticated and not simple at all. Could somebody explain how I package and deploy my app correctly?
I know that normaly a root Project with a root-Pom is created, that holds a EAR Project with the ear-Pom and the EJB Project with the ejb-jar
This is not necessarily the "normal" way. You can deploy a .jar containing EJBs on its own. Typically you would do this if the EJB beans are either called remotely (via RMI/#Remote or via SOAP/#WebService) or if the application contains some job-like logic (#Singleton/#Startup, or maybe JSR 352 Batching).
Could somebody explain how I package and deploy my app correctly?
In your pom.xml you should use <packaging>ejb</packaging>, that's basically it (assuming you have an otherwise valid pom.xml). The resulting jar can be deployed on its own. For GlassFish you would use the asadmin deploy command for this.

Eclipse: Debug war in ear when the war-file only is a maven-dependency instead of an eclipse project

We have the following packaging:
something.ear (eclipse-project)
+webstuff.war (maven dependency only)
+businessstuff.ejb (eclipse-project)
Packaging works perfectly and I am able to debug all the businessstuff. But how can I make the sourcecode of webstuff.war visible in eclipse and therefore set brakepoints and debug it?
ear and war have only java class files(which is not editable) and not java source code. Better approach is to use some logging framework(i personally prefer log4j).
Every java project developed nowadays have used some logging framework, better search for them in the ear and war files.
On extracting the war file u can see some xml or .properties file which will say what loggong framework it uses.