java-ee

EJB Interceptors and transaction lifecycle OR how to intercept a commit/failure event?

可紊 提交于 2020-01-04 07:01:00
问题 I have an EJB interceptor and I follow the BCE pattern suggested by Adam Bien, that is, all EJB calls on the boundary starts and finish a transaction which means there is no nested EJB calls (there might be nested CDI injected Bean calls though, but those should be inside the same transaction started at the ejb Boundary). So in those ejb Boundaries I have an interceptor and I want to intercept or know if after the method call of the EJB the transacction commited already? (that is, if a

How to programmatically check if an application has deployed in JBoss5?

你离开我真会死。 提交于 2020-01-04 06:53:55
问题 I am writing a small app to automate deployments. Basically, it checks an ftp server periodically for a new .ear file. Compares the checksum of the remote ftp file against what is currently deployed. If there is a new ftp file, then it gets picked up and deployed... I then have a check to see if the app has deployed successfully. At the moment, I am sending an http get requested for the main landing page of the app and then checking the http return code for a successful deployment. However, I

How to programmatically check if an application has deployed in JBoss5?

自闭症网瘾萝莉.ら 提交于 2020-01-04 06:50:04
问题 I am writing a small app to automate deployments. Basically, it checks an ftp server periodically for a new .ear file. Compares the checksum of the remote ftp file against what is currently deployed. If there is a new ftp file, then it gets picked up and deployed... I then have a check to see if the app has deployed successfully. At the moment, I am sending an http get requested for the main landing page of the app and then checking the http return code for a successful deployment. However, I

Separate same jars in different WAR of a EAR

给你一囗甜甜゛ 提交于 2020-01-04 06:44:11
问题 currently we are facing one problem. We are building a ear which contains multiple war files. In 2 of the WARs contains same jars. Both these wars need these jars during deployment.So Is there any way in ANT I can built it so that these jars will be in one single place and it will not create any problem during the ear deployment. 回答1: well, you can do it the portable way: Place the library jars at the root of .ear file. Example: library jar -> lib1.jar, lib2.jar [EAR STRUCTURE] your.ear |-

Separate same jars in different WAR of a EAR

☆樱花仙子☆ 提交于 2020-01-04 06:44:09
问题 currently we are facing one problem. We are building a ear which contains multiple war files. In 2 of the WARs contains same jars. Both these wars need these jars during deployment.So Is there any way in ANT I can built it so that these jars will be in one single place and it will not create any problem during the ear deployment. 回答1: well, you can do it the portable way: Place the library jars at the root of .ear file. Example: library jar -> lib1.jar, lib2.jar [EAR STRUCTURE] your.ear |-

Java EE best design approach. business logic layer?

感情迁移 提交于 2020-01-04 06:08:40
问题 The project I am working with uses JSF + Spring + Hibernate. This is a design question that I have often been confused about. I currently inherited a project that contains a dao -> service -> view -> controller "layered" approach. The "Controller" layer / tier? currently has all logic and objects that interact with the front end. I have been told that it is good practice to separate this into two layers/tiers, where the "Controller" layer/tier only contains methods/objects that interact with

Make custom hibernate validation annotation for email existence

蓝咒 提交于 2020-01-04 05:35:41
问题 i was wondering if it's possible to make custom hibernate validation annotation that will check in the database if the email exist or not (call dao method and return true if the email exist) so i can do something like: @NotBlank(message = "email is required") @Email(message = "{invalid.email}") @EmailExist(message = "{email.exist}") @Column(name = "email", length = 155, nullable = false) private String email; please advise with a sample if possible, thanks in advance. 回答1: Yes it should be

Background thread creation in Weblogic SOAP Webservice using Executor framework

∥☆過路亽.° 提交于 2020-01-04 05:35:28
问题 We have a SOAP webservice deployed on Weblogic server with the flow as follows. SOAP Client will send message to Webservice which validates the message and sends an Acknowledgement as response of the service. However, it is suppose to do a SocketConnection in the background to further process the message as asynchronously. The implementation that has been provided is to spawn a ChildThread in the background using ExecutorService.newFixedThreadPool . this is the code being used (not all the

How to get a trivial case of Spring MVC view (JSP) resolving to work?

梦想的初衷 提交于 2020-01-04 05:26:09
问题 My app uses Spring MVC (latest; 3.2.2) to create a RESTful API returning JSON, and so far I haven't needed a view layer at all. But now, besides the API, I need a simple utility page (plain dynamic HTML) and wanted to use JSP for that. I want requests to http://localhost:8080/foo/<id> to go through a controller (Java) and end up in a JSP. Should be simple, right? But I'm getting 404; something is not right in resolving the view. HTTP ERROR 404 Problem accessing /jsp/foo.jsp. Reason: Not Found

Remote interface cannot be cast to EJB container

落爺英雄遲暮 提交于 2020-01-04 05:18:46
问题 I have a EJB named "BookEJB", which implements an remote interface "BookEJBRemote" BookEJB is declared like this: @Stateless @Remote(BookEJBRemote.class) public class BookEJB implements BookEJBRemote{} BookEJBRemote is declared like this: @Remote public interface BookEJBRemote {} I have a file that does unit testing, and I got an error when I run the test. The error message is the following: java.lang.ClassCastException: _BookEJBRemote_Wrapper cannot be cast to BookEJB and the line that has