AndroMDA is not generating code - andromda

I have recently started with AndroMDA and was trying to write a application. I am doing following:
created project using AndroMDA archetype
created two entity classes
created two value object classes for above two entities
created a service class
Now when I run mvn install maven couldn't find my entity classes, nor my value object classes.
I had just generated these files (with mvn install I did before giving a reference of entities to service class).
My question is why is AndroMDA not creating these classes before using them?

Related

Using F# type providers in tests

I'm creating a class library with integration tests. I'm using combination of FsCheck and xUnit here. Tests are supposed to run queries on the database to verify an output. I'm using FSharp.Data.TypeProviders with System.Data.Linq (so Linq2Sql type provider) to access the database - type provider is defined inside test class library itself.
However when I'm trying to build a project, I'm getting a Static linking may not use assembly that targets different profile. error. Class library, where tests are located is targeting .NET Framework 4.5 (FSharp runtime 4.4.0). I've also set binding redirects for FSharp.Core assembly, however this doesn't change anything.

calling java component with multiple java classes from Mule

I am using Anypont Studio 5.3.0 and server runtime 3.7.0. I want to invoke a main() method from my component. Application is developed using Maven, SpringBoot and JPA. It sits in the jar file and have the following structure.
com
package
Application.class (with main method)
another package
Other classes
lib
other jars
META-INF
persistance.xml
MANIFEST.MF
Org
springframework boot loader and other spring classes.
when file arrives with file pattern that I detect with mule polling component I would like to invoke Java component in mule flow that has main class and all the supporting classes.
Thanks,
David
did you mavenize your Application? If yes, you can add that as a dependency in your mule project pom, which is also mavenize. But you need to make sure that the jars are added in your maven repository i.e. execute first "mvn clean install" to your java application. Otherwise, add the jars in you build path. When you are able to do those, you can create a spring bean or create a java component in mule where they could call your class with main() method.
I never came across this kind of production scenario where there is a need to call main method of java class in enterprise application. Are you sure you have only main method to access other classes, it should have initialize, spring way of injection etc. Simple answer to you question, create a mule java component and override onCall method to call Application(class).main. I will never do this kind of stuff [for sure it will give more problems based on what is being written in main method]. In general we will use main method invocation in desktop application. if possible work on (or let the application team to work on) jar file to have better initializing options

how to know which version of jar is my tomcat server using

Why I need to do this: In my application I have some JAR file for connecting to MYSQL DB, now I have to extend this API so that my application can communicate to MongoDB.To do this I have to make changes in existing JAR file.
I don't have the source code of the JAR files so I de-compiled it, used the code to implement the interfaces, now I am unable to make a JAR file because may be the de-compiler did not de-compile the classes properly in the first place. So I separately compiled the newly written classes, I want some of the new classes to overwrite the existing ones.
I know that tomcat looks for classes in the following order:
1. System class loader classes
2. /WEB-INF/classes of your web application
3. /WEB-INF/lib/*.jar of your web application
so I put new classes in /WEB-INF/classes/ directory.
My tomcat server is still not using the newly added classes, is there any way to know which class is my class loader using and how to make it load the newly added classes?

rmic code duplicate classes intellij

Trying to convert a project from RAD into intelliJ. The project contains a several ejb2 modeules and ejb client modules. The client modules contain There are a lot of modules that depend on each other and a lot of code that has been generated by the rmic compilier.
Most of the code is in the org.omg.stug.javax.ejb package. Is there anyway to tell intellij to ingore the duplicate classes?

Invalid ejb jar: it contains zero ejb.

I have 2 modules: ejb and war, and ear module, that contains them. Modules build successfully, but when I try to deploy ear to glassfish, I recieve this error:
glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=17;_ThreadName=Thread-2;|Exception while deploying the app [EarModule] : Invalid ejb jar [BackEnd-1.0-SNAPSHOT.jar]: it contains zero ejb.
Note:
1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean.
2. EJB3+ entity beans (#Entity) are POJOs and please package them as library jar.
3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (#Stateless, #Stateful, #MessageDriven, #Singleton), please check server.log to see whether the annotations were processed properly.|#]
I really don't know what to do, I've found a lot of questions like mine, but there was no solution.
I understood, what was wrong. The problem was in run configurations, I'm using Intellij Idea and in run configurations there was build and make before run of my ear module. I removed this and after maven install it deployed successfully.
You have to add an EJB into your WAR or EAR file. Just Create a new Class and annotate it with #Stateless
I know this is very build specific and it uses Netbeans instead of the OP's IDE but because I was lead here and this will likely be useful to some users:
I had the following build:
Netbeans Enterprise Application with Maven
Glassfish 4.1
Java EE 7
I had tried migrating from a previous non-maven enterprise application and the clone didn't quite work the way I expected, there was some old ejb jars lying around that I deleted.
I had done quite a few things to fix it:
Ensure theres no ejb jars lying around that shouldn't be there. Ensure that you don't have accidently have the ejb module jar included more than once as this can result in the same error too (Manually deploying the ear and deployment through netbeans sometimes gave me different errors).
I used the #Remote interface on my EJB applications. Now you should not be importing your EJB into your War, you should use the annotations correctly as described https://docs.oracle.com/javaee/7/tutorial/ejb-intro004.htm
(This is more of a note) When you update any of your war or ejb, clean and build them before cleaning and building your ear (sounds funny right?).
If you are using interfaces for your session beans then you should put them in a separate jar, make a new project maven > java application. Do the same thing with your persistence entities. Add these as dependencies to both your ejb and war project.
This doesn't relate to me in particular but you should have at least 1 #stateless (or I think #stateful) annotation in a java class inside your ejb module for it to run (for the module to be considered an ejb).
I likely had to do a few more things that I forgot but if you still run into issues comment below and I'll try to update.
Just try to build & install your project using Maven , and then , deploy it in glassfish ( do not run your project directly from your IDE )
I encountered this problem as well. It occurred when I had imported a new EJB project into my Eclipse workspace. The project didn't have a reference to the Glassfish libraries then, since it was not yet included in the EAR deployment assembly.
Upon saving the Bean file, the IDE automatically imported javax.inject.Singleton instead of javax.ejb.Singleton. This made the code compile without warnings, but throw the same error as in the original post.