Please explain what is this project is about (Multi Module Java Project)?
I have no idea what's going on here with the ejb, cor, web and stuff
and the purpose of this project.
70 Replies
⌛
This post has been reserved for your question.
Hey @Rag...JN 🌌 🦡 👽 💰! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
ok so you have multiple modules
You can imagine each of these modules as its own Maven project
But
- When building the top module, it builds all of the modules
- Modules can be dependencies of each other
ok alright
e.g. the web module uses the core module
I want to run the app
Is it same like running with adding a the server ?
?
like this
it has 4 artifacts
you probably need one of the web ones
actually I think you need one of the ear ones
ok let me try
no it can't
only the war
alright I managed to run it
I needed to use GlassFish instead of Payara
@dan1st | Daniel forgive me for the ping
But what subject is this, so I can learn about it
Jakarta EE deployments
essentially WAR and EAR are special JAR files that can be deployed to Jakarta EE servers
How about these annotations and stuff
WAR = web application archive
EAR = enterprise application archive (I think)
which annotations specifically?
The stateless
in package jakarta.ejb
it's a Jakarta EE annotation: https://jakarta.ee/specifications/platform/11/apidocs/jakarta/ejb/stateless
Stateless (Jakarta EE Platform API)
declaration: package: jakarta.ejb, annotation type: Stateless
I have no clear idea where to start still. So I will try with Jakarta EE deployments ?
I mean, I guess you generally want to get an idea about Jakarta EE
I think information on stateless itself can be found in the spec here: https://jakarta.ee/specifications/enterprise-beans/4.0/jakarta-enterprise-beans-spec-core-4.0#stateless-session-beans
alright sir
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
why this can't be in just the main project's src or just inside the web project packages?
you create a package called core for interfaces and ejb for interface implementation
and use them inside the controllers
could be maintainability
it's easier to maintain multiple smaller modules than one big module in many cases
alright alright that make sense
or you could have a client and a server
and they share some code
so you create 3 modules - one for the common code, one for the server and one for the client - then the client doesn't contain the server code and vice-versa
or you could have different teams working on different modules
ok
Inside the web moduel's pom.xml
So this plugin does this
The WAR Plugin is responsible for collecting all artifact dependencies, classes and resources of the web application and packaging them into a web application archive.So only what's inside the web module gets packaged?
the war plugin essentially creates the WAR file
but here the core module also used as a dependency it will be packaged as well?
and for that, it uses the dependencies of the same module
and the code in that module ofc
So what if I used the web module as a dependency inside the core module as well?
will there be an exception occur
then you have circular dependencies so yes
because web requires core which requires web
core
----pom.xml
================= dependency -> has web module
web
---pom.xml
================ dependency -> has core module
alright ok got it
However, it might be possible as a test dependency
but I didn't test that (pun intended)
ok
what is this section (the right bar) I only declared one plugin but the bar has multiple plugins?
the core plugins
These are plugins Maven adds by default
For example the compiler plugin compiles your application
Also you have a
<parent>
element, right?yah
almost all configuration from the
<parent>
is copied to the child
and there's kinda a default parent which isn't really shown
and you can also add stuff to the POM via profilesoh shit I removed the maven-war-plugin and now the war core plugin is gone
So the remaining are the default core plugins
You can execute the command
mvn help:effective-pom
and it should show you the POM after these things have been applied
Do you have a <packaging>
tag?yep
ok
I thought that should add the
maven-war-plugin
by default
but maybe it's just IntelliJ not showing itno no I added it default (followed the sample project)
I meant that Maven should implicitely add it if you don't
alright
module ejb's pom.xml
questions
1. why ejb uses web api
2. why core module is used as a jar type dependency
3. what's up with the ejb plugin
why ejb uses web apitbh I don't know - but I guess it's so that when you deploy the EAR, everything from the web package should be included as well
why core module is used as a jar type dependencyjar is the default - if you just want to use something as a library/used by other things OR if you want to execute it with
java -jar
, you'd normally use jar
what's up with the ejb pluginI think that's responsible for the EAR file but I have never worked with EJB/EAR stuff
hope me neither 😆
probably this
and I think this creates an EAR file in the
package
phaseI will first study about EJB and then EAR
^
idk how helpful the spec is for that
I will see
i am going to eat now
You might be more successful with tutorials or blog posts about it
the spec is probably more useful for reference or if you want to implement a server
What does it mean by local and remote
It's something with RMI?
where does it say that?
local typically means on the same device
and remote typically means on a different one
Starting from line 8
ah there
I looked over that
yeah local network access means things on the same computer (or maybe things in the same network)
and remote means communicating with other servers or similar
yah but why it matters when you run a server?
oh wait
no stupid question
I mean, idk much about EJB
As I said, maybe check introductory articles orr similar
maybe there are some freely available books as well if you are into books
ah ok btw any idea if I can do this tutorial in a plain ant project?
https://www.javatpoint.com/RMI
www.javatpoint.com
Remote Method Invocation (RMI) - javatpoint
Remote Method Invocation (rmi) is an API that provides a mechanism to create distributed application in java.
ok I downloaded the project
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.