java-ee-6

Are CDI event observer methods compatible with EJBs?

守給你的承諾、 提交于 2019-12-10 03:03:30
问题 I have a Singleton EJB (javax.ejb.Singleton version. sigh.) which has a CDI observer method on it. When I try to deploy this to glassfish 3.1 the server fails to deploy the EAR file without any real explanation - simply saying there was an exception during deployment without any more details. SEVERE: Exception while loading the app SEVERE: Exception while shutting down application container .... SEVERE: Exception while shutting down application container : java.lang.NullPointerException This

javax.security.auth.login.LoginException: Security Exception

一个人想着一个人 提交于 2019-12-09 07:06:51
问题 I am attempting to setup container managed security with GlassFish v3.1.2 and JSF 2.1 and primeFaces 3.4.2 The value HexValue and the database match, but get the following Exception I tried Base64 encoder but same result. The calculated value, and password are fine, something else I missed out... is there any other setting that I am missing out esp in glassfish or login.xhtml file username: admin1 pass: admin using following SHAConverter.java Used org.apache.commons.codec.digest.DigestUtils;

How to model in Java EE?

好久不见. 提交于 2019-12-09 04:41:24
问题 Let's say, I have decided to go with Java EE stack for my enterprise application. Now, for domain modelling (or: for designing the M of MVC), which APIs can I safely assume and use, and which I should stay away from... say, via a layer of abstraction? For example, Should I go ahead and litter my Model with calls to Hibernate/JPA API? Or, should I build an abstraction... a persistence layer of my own to avoid hard-coding against these two specific persistence APIs? Why I ask this: Few years

EJB 3.1 in war package in WEB-INF/classes - javax.ejb.CreateException: Could not create stateless EJB

我怕爱的太早我们不能终老 提交于 2019-12-09 03:39:09
问题 I think, I misunderstood rules of packaging ejb beans in war package. Goal: I want to use ejb beans in war package. Scenario: I have some bean in my war: @Stateless public class RegistrationServiceBean { @PersistenceContext(unitName = "Utopia") EntityManager em; public RegistrationServiceBean() {} @Schedule(hour = "*", minute = "*", second = "*/15") public void baseRegistration() { System.out.println("call from ejb!!"); } public void saveTempPartner(OasysPartnerTempEntity part) { em.persist

How to handle polymorphism with JSF2?

女生的网名这么多〃 提交于 2019-12-09 00:39:25
问题 I need to display/edit polymorphic entities. My abstract class is Person . My concrete classes are PhysicalPerson and MoralPerson Each concrete class has its own custom attributes. How can I use the appropriate display/edit (composite) component according to entity class ? Thanks ! :) 回答1: There is no such thing as instanceof in EL. You can however (ab)use Object#getClass() and access the getters of Class in EL as well. Then just determine the outcome in the component's rendered attribute. <h

Using EJBContext getContextData - is this safe?

≡放荡痞女 提交于 2019-12-08 22:19:30
问题 I am planning to use EJBContext to pass some properties around from the application tier (specifically, a message-driven bean) to a persistence lifecycle callback that cannot directly be injected or passed parameters (session listener in EclipseLink, entity lifecycle callback, etc.), and that callback is getting the EJBContext via JNDI. This appears to work but are there any hidden gotchas, like thread safety or object lifespan that I'm missing? (Assume the property value being passed is

ui:repeat using the same client id. c:foreach works fine

淺唱寂寞╮ 提交于 2019-12-08 16:27:31
I know this may have something to do with the phase each one comes in at. If I do this. <ui:repeat id="repeatChart" varStatus="loop" value="#{viewLines.jflotChartList}" var="jflotChart"> <p:panel> <jflot:chart height="300" width="925" dataModel="#{jflotChart.dataSet}" dataModel2="#{jflotChart.dataSet2}" xmin="#{jflotChart.startDateString}" xmax="#{jflotChart.endDateString}" shadeAreaStart ="#{jflotChart.shadeAreaStart}" shadeAreaEnd ="#{jflotChart.shadeAreaEnd}" lineMark="#{jflotChart.wrapSpec.benchmark}" yMin="#{jflotChart.yMin}" yMax="#{jflotChart.yMax}" /> </p:panel> <br /> </ui:repeat> My

GlassFish 3.1.2.2 war can't find jar inside ear

喜夏-厌秋 提交于 2019-12-08 13:35:10
问题 I have built an ear with this structure (not all files shown here): myapp.ear/ myapp-ejb.jar myapp-web.war META-INF/ application.xml lib myapp-common.jar The problem is, when code in the war tries to reference classes in myapp-common.jar, it throws java.lang.ClassNotFoundException . Note the contents of META-INF/application.xml : <?xml version="1.0" encoding="UTF-8"?> <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi

Lookup of same EJB on multiple servers

我们两清 提交于 2019-12-08 12:54:35
问题 I am trying to do a lookup from one deployment to another deployment, using exactle the same bean implementations. It is basically a consumer/producer setup with the same beans in both deployments on both machines. ear ejb-api com.example.bean ConsumerBean ProducerBean ejb-jar com.example.bean ConsumerBeanRemote ProducerBeanRemote The ProducerBeanRemote should look up the ConsumerBeanRemote and call its public method. Our machines are communicating like this: (Machine A) ProducerBeanRemote --

How to call servlet or web service from JSF backing bean?

≯℡__Kan透↙ 提交于 2019-12-08 11:48:39
问题 I seriously cannot find the correct way to do this. I have this method and it works, but it seems kind of a work around to do something so basic. FacesContext context = FacesContext.getCurrentInstance(); String baseURL = context.getExternalContext().getRequestContextPath(); String startDateString = sdf.format(startDate); String endDateString = sdf.format(endDate); String url = baseURL + "/Excel?pkgLineId="+selectedPkgLine.getPkgLineId()+"&dateStart=" + startDateString + "&dateEnd=" +