java-ee

Custom Log Level

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 02:31:07
问题 In my existing application " org.apache.log4j " API's have been used in java code. Requirement : I have to log some statement(say xyz) in log file in any case and should not dependent of log levels.For example : if my log level is error then also xyz should print, if my log level is debug then also xyz should print. I cannot make log statement of xyz is debug because if i do this, other log statements apart from xyz will also start printing. For this, I believe, I have to add some custom log

Scheduled task executed twice

三世轮回 提交于 2020-01-05 22:22:13
问题 I have a Stateless session bean with two @Schedules : @ConcurrencyManagement(ConcurrencyManagementType.CONTAINER) @Stateless @Lock(LockType.WRITE) @AccessTimeout(value = 0) public class ScheduledTask { @EJB private SomeClass sClass; @Schedules({ @Schedule(hour = "*", minute = "*/10", info = "Automatic timer to send")}) public void send() { sClass.doWork(true); } @Schedules({ @Schedule(hour = "*", minute = "*/35", info = "Automatic timer to receive")}) public void receive() { sClass.doWork

How to propagate CDI session beans from HTTP session to WebSocket session?

自闭症网瘾萝莉.ら 提交于 2020-01-05 13:38:14
问题 I googled a lot for this problem before posting this question and Accessing HttpSession from HttpServletRequest in a Web Socket @ServerEndpoint is one of the best Questions/Answers I was able to found, but it appears to not solve my problem. I was able to access HttpSession from websocket in this way, but I can't access the same CDI session bean instances as from normal HTTP requests. I tried to store in session the HttpSessionContextImpl Weld instance too and tried to use it on WebSocket

How to propagate CDI session beans from HTTP session to WebSocket session?

二次信任 提交于 2020-01-05 13:37:30
问题 I googled a lot for this problem before posting this question and Accessing HttpSession from HttpServletRequest in a Web Socket @ServerEndpoint is one of the best Questions/Answers I was able to found, but it appears to not solve my problem. I was able to access HttpSession from websocket in this way, but I can't access the same CDI session bean instances as from normal HTTP requests. I tried to store in session the HttpSessionContextImpl Weld instance too and tried to use it on WebSocket

Using GlassFish v3, EJB and SOAPUI

不羁岁月 提交于 2020-01-05 12:14:00
问题 I would like to create a web service. I am using Glassfish v3, an Eclipse Dynamic Web Project, and SOAPUI to test. I have the following code in eclipse: Class MyLogin package packageTest; import java.io.IOException; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public class MyLogin { @WebMethod public AuthInfo login(@WebParam(name = "email") String email,@WebParam(name = "password")String password) throws IOException, CustomException { if(email == null || email.isEmpty(

Using GlassFish v3, EJB and SOAPUI

 ̄綄美尐妖づ 提交于 2020-01-05 12:13:32
问题 I would like to create a web service. I am using Glassfish v3, an Eclipse Dynamic Web Project, and SOAPUI to test. I have the following code in eclipse: Class MyLogin package packageTest; import java.io.IOException; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public class MyLogin { @WebMethod public AuthInfo login(@WebParam(name = "email") String email,@WebParam(name = "password")String password) throws IOException, CustomException { if(email == null || email.isEmpty(

response code 500 when returning an object using @ResponseBody

岁酱吖の 提交于 2020-01-05 11:02:50
问题 I'm fairly new to spring Restful programming The requirement to use the controller method as a rest service, so I'm trying to return an object in a JSON format, but for some reason I'm getting a response code as 500 with no errors and exceptions in log files. But it is successfully working if I the return type is of a string rather an object I'm using the jackson dependencies and I'm configuring in context file and in a assumption that converts the object to json format and puts in the

Should I use dataTable or panelGrid? JSF

﹥>﹥吖頭↗ 提交于 2020-01-05 11:02:24
问题 <table id="tbl" cellpadding="5" cellspacing="0" border="0" class="display" style="padding-top: 10px;width:100%"> <thead> <tr> <th width="20%">Emp No</th> <th width="15%">title</th> <th width="20%">Name</th> <th width="10%">shift</th> </tr> </thead> <tfoot> <tr> <th></th> <th></th> <th></th> <th></th> <th></th> <th></th> </tr> </tfoot> <tbody style="cursor:pointer;"> Yeh aik arzi tehreer hai </tbody> </table> When I started to convert this code for my JSF app I found that I can use either <h

response code 500 when returning an object using @ResponseBody

你说的曾经没有我的故事 提交于 2020-01-05 11:02:20
问题 I'm fairly new to spring Restful programming The requirement to use the controller method as a rest service, so I'm trying to return an object in a JSON format, but for some reason I'm getting a response code as 500 with no errors and exceptions in log files. But it is successfully working if I the return type is of a string rather an object I'm using the jackson dependencies and I'm configuring in context file and in a assumption that converts the object to json format and puts in the

How to convert Maven War project to an EAR project in Openshift?

女生的网名这么多〃 提交于 2020-01-05 08:56:44
问题 I have created an JEE application in Openshift using the JBOSS AS 7.1 cartridge a Maven project have been generated with the War deployment format. I need to use EJBs into the application but the War format cannot hold EJB so I changed the from War to Ear, the problem is that when I deploy the Ear the application does not Work(404 Error when I access the home page). Is there any simple solution in order to make this work? Or Should I create two seperate projects(one EJB project and another