java-ee

Correct Usage of Stateful Session Bean in EJB

风流意气都作罢 提交于 2019-12-23 03:29:10
问题 I am trying to construct a test website that display various information about a student with JSF 2.0, EJB 3.1 and JPA 2.0. After a student login, the student can browse different pages for displaying different kind of information, which is what a usual registration management system does. Say displaying a timetable according to enrollment information in one page, and display the assignments in another page. Information that will be displayed include attributes of the student, mapped entities

Using log4j in oc4j 10.1.3

爷,独闯天下 提交于 2019-12-23 03:20:35
问题 I have a web application running on OC4J 10.1.3. I am trying to do some logging using log4j. The messages show up in my IDE console as expected, but nothing is going into the application.log in OC4J. Anybody know what I need to do to get this working? Here's my log4j.properties: log4j.rootCategory=DEBUG, CON1 # CON1 is set to be ConsoleAppender sending its output to System.out log4j.appender.CON1=org.apache.log4j.ConsoleAppender log4j.appender.CON1.layout=org.apache.log4j.PatternLayout log4j

java.lang.runtimeexception java.net.connectexception while running hadoop pi example

十年热恋 提交于 2019-12-23 03:18:19
问题 i have configured hadoop on two machine. i can access both machine without password using ssh.i have successfully formatted namenode using following command:-- bin/hadoop namenode -format then i tried to run pi example which shipped with hadoop.tar sandip@master:~/hadoop-1.0.4$ bin/hadoop jar hadoop-examples-1.0.4.jar pi 5 500 Number of Maps = 5 Samples per Map = 500 13/04/14 04:13:04 INFO ipc.Client: Retrying connect to server: master/192.168.188.131:9000. Already tried 0 time(s). 13/04/14

maven, hibernate, spring problems

元气小坏坏 提交于 2019-12-23 03:16:28
问题 i have a problem with a project that i want to run with maven, in with i use spring and hibernate, i'm new to these technokogies by the way. just if someone can hepl me solve the problem, on post me an example which cab be runned easly , thnas you this is my exception : org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory

How to incorporate mysql into Jboss quickstart tutorial

僤鯓⒐⒋嵵緔 提交于 2019-12-23 03:13:19
问题 I am trying to set up a mysql database in a JBoss project. I am getting errors about JBAS014775: New missing/unsatisfied dependencies. I have read countless posts on SO and I am still not sure why these problems are arising. I have pasted the error logs from the console down below The module file looks as follows: <?xml version = "1.0" encoding = "UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="com.mysql"> <resources> <resource-root path="mysql-connector-java-5.1.23-bin.jar"/> </resources

java.lang.ClassCastException: $Proxy99 cannot be cast

て烟熏妆下的殇ゞ 提交于 2019-12-23 03:12:58
问题 I am using JBoss4.2.2 and java6. The deployed ear's name is apa.ear In a servlet I have the following code line: placeBid = (PlaceBid) context.lookup("apa/" + PlaceBid.class.getSimpleName() + "/remote"); I have a generated jboss-app.xml like this: <jboss-app> <loader-repository>apa:app=ejb3</loader-repository> </jboss-app> When trying to get the PlaceBid via the context I get this exception java.lang.ClassCastException: $Proxy99 cannot be cast to se.nextit.actionbazaar.buslogic.PlaceBid The

Create EJB with two interfaces. @Local interface for web module and @Remote interface for local app client

可紊 提交于 2019-12-23 03:11:55
问题 I have a EAR package that contains a web module and EJB. The EJB is currently exposed its contains to local app client via Remote interface @Stateless public class CoreEJB implements CoreEJBRemote { @PersistenceContext(unitName = "CoreWeb-ejbPU") private EntityManager em; @Override public void packageProcess(String configFileName) throws Exception { //Process logics } @Override public <T> T create(T t) { em.persist(t); return t; } @Override public <T> T find(Class<T> type, Object id) { return

Logger, convert from @Inject to producer

喜夏-厌秋 提交于 2019-12-23 02:45:25
问题 I am having trouble implementing a Login interface like the example Simple CRUD Web Application with JSF 2.1, PrimeFaces 3.5, EJB 3.1, JPA (ORM) / EclipseLink, JAAS , MySQL On TomEE's mailing list, I have been told that the LoginController.java I am using tries to inject Logger, but Logger injection is not managed by CDI. I have been told to use a producer instead. Not knowing what it is, I searched on the internet and I found this example But I am still not confortable with it, so please

Restrict a user login to single session at a time using java, hibernate web application without spring

风流意气都作罢 提交于 2019-12-23 02:34:36
问题 I am developing a web application using Java , Hibernate and JSF. I want a user to restrict to login to a single session only, that I if user is already logged in I don't want to login it back from other location without logging out the first session. Can anyone help in letting know how that can be achieved. To mention that as per my requirements I can't use spring or its any feature. 回答1: You would have to maintain a application scoped Set<Long> that contains all the logged in user logical

non serializable session websocket java ee

醉酒当歌 提交于 2019-12-23 02:26:44
问题 I write a ExchangeMoney class implements Serializable interface . This class has Session (javax.websocket.Session) property. See code below: import javax.websocket.Session; import javax.websocket.EncodeException; import java.util.logging.Level; import java.util.logging.Logger; import java.io.Serializable; ... public class ExchangeMoney implements Serializable { private static final long serialVersionUID = -4363184570862565571L; private static final Logger logger = Logger.getLogger(