java-ee

Elegantly handling constraint violations in EJB/JPA environment?

I'm working with EJB and JPA on a Glassfish v3 app server. I have an Entity class where I'm forcing one of the fields to be unique with a @Column annotation. @Entity public class MyEntity implements Serializable { private String uniqueName; public MyEntity() { } @Column(unique = true, nullable = false) public Str...

Using Session Bean provided data on JSF welcome page

I use JSF managed beans calling EJB methods that are provide data from database. I want to use some data already on the welcome page of the application. What is the best solution for it? EJBs are injected into JSF managed beans and it looks like the injection is done after executing the constructor. So I am not able to call EJB methods ...

How to learn high-level Java web development concepts

I have some experience writing web applications in Java for class projects. My first project used Servlets and my second, the Stripes framework. However, I feel that I am missing the greater picture of Java web development. I don't really understand the web.xml and context.xml files. I'm not sure what constitutes a Java EE applicatio...

How to use EJB 3.1 DI in Servlet ? (Could not inject session bean by @EJB from web application)

I am tying to merging web application(gwt, jpa) to an separate 2 application(business login in ejb/jpa and web client in gwt). Currently i can`t inject my beans from web application (simple servlet) I am using glassfish v3. module limbo(ejb jar) is in dependency of module lust (war). If I use lust with compiler output of limbo everythi...

Splitting EJBs and interfaces into separate module -- deployment fails

I'm having trouble following this guide to "extract" my interfaces and entities from my EAR to use them from another Web Application: I use NetBeans 6.8 and Glassfish 3.0.1 "Java Class Library" project contains all the entities and interfaces "Java EE Application" project class library added to the project, is packaged into the EAR ...

How to install the GlassFish 3 server adapter with Eclipse Helios 3.6

Question as stated in the title: how to install the GlassFish Server Adapter on Eclipse Helios 3.6? ...

Servlet 3.0 annotations <welcome-file>

Is it possible to set welcome-file tag from standard web.xml file by servlet 3.0 annotation ? <welcome-file-list> <welcome-file>PageName.html</welcome-file> </welcome-file-list> ...

avaStatic factory pattern with EJB3/JBoss

I'm fairly new to EJBs and full blown application servers like JBoss, having written and worked with special purpose standalone Java applications for most of my career, with limited use of JEE. I'm wondering about the best way to adapt a commonly used design pattern to EJB3 and JBoss: the static factory pattern. In fact this is Item #1 i...

Am I allowed to declare a lifecycle interceptor on an interceptor?

I have my business bean defined thus: @Local @Interceptors(BusinessInterceptor.class}) public class MyBean implements SomeBean { ... } And then I want my BusinessInterceptor to be configured with Spring's SpringBeanAutowiringInterceptor: @Interceptors(SpringBeanAutowiringInterceptor.class) public class BusinessInterceptor { @Auto...

JSF: How can I check whether I'm in the "Restore View" phase?

When a particular method in my managed bean gets called, I want to know whether I'm in the Restore View phase of the JSF Lifecycle. How can I do this? ...

What are the essential Java libraries and utilities for a returning dynamic language user?

Guys, Long time Java developer here, but I've spent more time working with Ruby over the past 3 years or so as far as web applications go. I really have enjoyed it, but there are concerns I've uncovered that I won't cover here. Now that I've found the Play! framework, I'm thrilled about the prospect of having a Rails-like experience wi...

JSF Page does not submit when onclick javascript is added to menu item?

I show some detail using popup windows. I want to close those when the user clicks on sign-out link. I have a JavaScript function that'll close the windows. The sign-out link is rendered using Navigation MenuModel. The definition in faces-config is as below - <managed-bean> <managed-bean-name>signoutNavigation</managed-bean-name> ...

How can I implement a proper counter bean with EJB 3.0?

[EDIT] This question is "how do I do atomic changes to entity beans with EJB 3 and JPA 2.0". Should be simple, right? I tried to fix my code based on the answers I got so far. I'm using JBoss 6.0.0M2 with Hypersonic (just download it and call run.bat). My test case: Create 3 threads and call one of the testCounterMitLock*() 500 times i...

Why wouldn't a flex remoteobject be able to work within a custom component?

Please enlighten this flex noob. I have a remoteobject within my main.mxml. I can call a function on the service from an init() function on my main.mxml, and my java debugger triggers a breakpoint. When I move the remoteobject declaration and function call into a custom component (that is declared within main.mxml), the remote functio...

What happens when several Java servlet apps running on the same port ?

Something strange happened to my servlets and I think I've figured out why, yet I'm more confused. I used Netbean6.7 to develop a Paypal IPN (Instant Payment Notification) message servlet, it listens on port 8080 by default for Paypal IPN messages. I used some sample Java code from it's web site, but when it ran, only about 1 in 10 messa...

Java EE - newbie question (not related to learning JEE)

I've read lot of articles saying, that Java EE is most popular enterprise solution nowadays. Let's not argue if it is most popular or second most popular or what. The thing is : I see almost all web pages with extension like .html, .php and .aspx. Why there is (almost) none .JSP ? Why so ease to find ASP.NET pages if it is supposed to b...

What is the difference between Java RMI and JMS?

When designing an distributed application in Java there seem to be a few technologies that address the same kind of problem. I have briefly read about Java Remote Method Invocation and Java Message Service, but it is hard to really see the difference. Java RMI seems to be more tightly coupled than JMS because JMS uses asynchronous commun...

java.lang.ClassCastException: $Proxy99 cannot be cast

Hi, 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>...

Eclipse JavaEE deployment exception

org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException: WEB-INF/web.xml Did anyone have the same problem in the past? ...

HTML form submits and the hostname changes to IP address

I am facing a peculiar problem. The problem is, my webapp is being installed behind a proxy. The request gets submitted to the proxy which forwards the request to the original host that is running the websphere web application. The problem I am facing is, when I access the webapp, its URL looks like the below http://www.myproxy.com L...