Java-EE | Java EE Examples -
kandi X-RAY | Java-EE Summary
kandi X-RAY | Java-EE Summary
Java EE Examples
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Java-EE
Java-EE Key Features
Java-EE Examples and Code Snippets
Community Discussions
Trending Discussions on Java-EE
QUESTION
How do I define a jsf composite component properly such that its value gets bean-validated correctly in the case it contains a collection?
We have an entity that references a collection of details. Both are annotated with bean-validation-constraints. Please note the annotations at the details
-property.
ANSWER
Answered 2021-Feb-19 at 14:04After diving into this a bit we endet up with a solution using a backing component ValidateListComponent
. It was inspired by UIValidateWholeBean
and WholeBeanValidator
.
That component extends from UIInput
and overrides the validation-Methods to operate on a clone of the above details
-collection which gets populated with the already validated values of the children-UIInput
. Seems to work for now.
QUESTION
I setup simple java ee project and using jta transaction and using OpenJpa 2.4.2 as Jpa provider, maven 3.3, eclipse 2020-06, jdk 8U2002, weblogic 12.4.2 and java ee 6 and get this exception:
...ANSWER
Answered 2021-Feb-16 at 10:23as OpenJpa documentation Section 2, “ Integrating with the Transaction Manager ”
says, I should add to persistence.xml.
By this property, OpenJpa understands that should uses container's managed transaction.
In case of weblogic, I do not need to configure "openjpa.ManagedRuntime " property.
and according to Section 2.1, “ Managed and XA DataSources ”.
"When using a managed DataSource, you should also configure a second unmanaged DataSource that OpenJPA can use to perform tasks that are independent of the global transaction. The most common of these tasks is updating the sequence table OpenJPA uses to generate unique primary key values for your datastore identity objects. "
So, this is my persistence.xml:
QUESTION
I have a web application currently deployed on Wildfly 22, using JSF 2.3 and OpenJDK 11. I'm currently migrating the login page from j_security_check to a programmatically login, following BalusC example on this post:
Performing user authentication in Java EE / JSF using j_security_check
I'm not posting the login code, because it's exactly like BalusC post.
The login process is working just fine, except when the session-timeout expires on the login page. In other words, when the user requests a protected resource, the login page is presented. If the session expires before the login form is submitted a ViewExpiredException
is thrown and an error is presented to the user.
I understand this is the expected behaviour, however it's not the desired situation for the end-user.
I managed to minimize this situation using OmniFaces's ViewExpiredExceptionHandler
.
This way, when a ViewExpiredException
is thrown, the OmniFaces handler will catch it and redirects to the current URL with the query string.
In other words, the user tries to login after the session expires and the login page is presented again to the user.
I managed to use the #{flash['org.omnifaces.view_expired'] eq true}
so that a nice message is presented to the user, explaining that a timeout occurred.
Is there any way to workaround this situation, and performing a successful login even when the session expires, so that the user doesn't have to enter his credentials twice?
Thanks for your help!
...ANSWER
Answered 2021-Jan-22 at 17:37Is there any way to workaround this situation, and performing a successful login even when the session expires, so that the user doesn't have to enter his credentials twice?
Yes, by using stateless JSF by setting transient
attribute of to
true
.
QUESTION
so i want to connect a mongodb atlas cluster to a jpa project
i could connect to mongodb local with this repo : https://github.com/i0712326/java-ee-hibernate-mongodb/tree/main/java-ee-09-hibernate-ogm
but how much i changed its persistanse.xml file to able to connect to atlas it didnt work... i used almost all of property in this page : https://github.com/WiPeK/JavaEE-Bank/blob/5446e1c0fc87b7d4ef28e89bd3c5542de62ecaa7/shared/src/main/resources/META-INF/mongo-persistence.xml
i think problem is from host property so i used this property:
...ANSWER
Answered 2021-Jan-19 at 10:47The dependencies you are using are pretty old. I'm not sure they support MongoDB Atlas, they don't support setting multiple hosts in the configuration property.
That's why you are having the NumberFormatException
.
The latest Hibernate OGM version available is 5.4.1.Final. Unless you have strict requirements about the dependency to use, I would try to use that one: https://hibernate.org/ogm/releases/5.4/
QUESTION
I am trying to make Hello World web application using Eclipse and Java-ee 8, but i can not access .xhtml file, getting 404 error.
It is Maven project.
Before i deploy and run on server, which is WildFly 21.0.2, i do Maven -> Update and Run as -> Maven -> Clean verify.
The server is starting OK, because i can access it at localhost.
Page i am trying to access is index.xhtml, which is in webapp folder next to WEB-INF folder.
There is a similiar question: Error 404 - Not Found Wildfly, but restarting Eclipse did not help.
Page is accessible when i deploy to Apache TomEE 8.0.5 web profile.
When i deploy my java-ee-8 application to WildFly 21.0.2 server (also tried 19.1.0) i can not access xhtml page. I get 404 error code. When i deploy to Apache TomEE 8.0.5 web profile, page is accessible. Both servers are compatible with java-ee-8 and started successfully. No errors in console nor logs.
No configuration were done to the servers, i just added them to Eclipse and started. Same project was deployed. Does anyone know where could be the problem? I want to deploy my app to WildFly, not TomEE.
TomEE starting log, also with accessing the page: https://textuploader.com/185ql
WildFly starting log (nothing in console when trying to access the page): https://textuploader.com/185qc
project structure:
pom.xml:
...ANSWER
Answered 2021-Jan-03 at 19:43URL I am trying to access is this: http://localhost:8080/eshop-web/index.xhtml
The context path is wrong.
In case of WildFly, the actually used context path is logged with key WFLYUT0021
.
The following line is found in your WildFly startup log when searching for this key:
23:00:04,727 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 81) WFLYUT0021: Registered web context: '/javaee-test-0.0.1-SNAPSHOT' for server 'default-server'
So, adjust the URL accordingly: http://localhost:8080/javaee-test-0.0.1-SNAPSHOT/index.xhtml
QUESTION
There's chapter 10 in the book "Pro JPA 2 in Java EE 8", section called "Multiple Mapped Attributes", there the well-known department-project example using @IdClass
, full example code at https://github.com/Apress/pro-jpa-2-in-java-ee-8/tree/master/examples/Chapter10/08-multipleMappedAttributes/src/model/examples/model.
Short story below.
Project entity:
...ANSWER
Answered 2020-Nov-19 at 21:33As per anything to do with JPA, while the book is nice (and written by very knowledgable people, one of whom was directly involved in writing the spec), if there is anything in doubt, go to the spec itself for clarification. Derived ID is covered with examples in section 2.4.1 and would clear this up for you. It requires a ProjectId.class to use the same name as the ID value in the entity, and the same type as the ID it refers to - same format as you did for DeptId. In this case, it would need to be:
QUESTION
I would like to know if there is any way to change the color of the bulleted item in tree view in Eclipse while using a dark theme. I found this post that show the same problem but the post focus only on font and background color, not the bullet itself.
...ANSWER
Answered 2020-Jul-25 at 07:53So it seems the problem is reccurent with Eclipse 2020-06 and windows 7. I was able to reproduce the bug on 2 differents computers.
Reverting to Eclipse 2020-03 has sloved the problem.
QUESTION
I have come across a rather curious issue with wildfly classloading. I have a java-ee webapp, structured as follows:
...ANSWER
Answered 2020-Aug-17 at 16:56Each sub-deployment would need it's own set of module dependencies. If you were to include the module libraries in the EAR/lib
directory instead of creating a module then you'd not need to add the module dependency for each sub-deployment.
QUESTION
this is my firt try with a Maven project using Wildfly. So, this is my standalone file in xml for datasource:
...ANSWER
Answered 2020-Aug-17 at 08:12You should configure your datasrouce in wildfly itself. Also I'm not familiar with ironjacamar description file but the driver should be defined somewhere.
QUESTION
I’m reading thru this tutorial:
It first runs: ClientAllOrders()
, which creates 5 orders. Then it runs: ClientDeleteById()
, which deletes orders 2 and 4. Then it runs ClientAllOrders()
, and gets all orders except for orders 2, 4. It creates orders here:
ANSWER
Answered 2020-Jul-26 at 12:09The client and the server run in separate processes, in separate JVMs, independently. The server has one version of enum OrderService
, and the client has another. Nothing links these two instances of the enum to each other.
In your case, the "server" is an application server, where you deploy the web application "war" archive. The "client" is a separate Java program with a main
method. that you run from your IDE with the "run as Java application" action.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Java-EE
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page