java-ee-6

Java EE 6 Maven Project Setup in Netbeans - some configuration issues?

I've been trying to set up a Java EE 6 Maven project via New Project -> Maven -> Maven Enterprise Application. However, when I try to run the application I've been running into a couple problems: I had to change the the http port that Glassfish listens on because the port it chose (8080) was already used. I went into the domain.xml fi...

Servlet 3.0 asynchronous

Hi All! What's the diffrent between servlet 3.0 asynchronous feature against: old servlet impl doGet(request,response) { Thread t = new Thread(new Runnable() void run(){ // heavy processing response.write(result) } } In servlet 3.0 if I waste a thread to do heavy processing - I earn one more thread in the co...

Enterprise Aplication with EJB, JSF and JAX-RS

What is the best Maven archetype to use on enterprise application in java using EJB and JAX-RS, considering that in a near future i will have to make a front-end in JSF2 using as the backend EJBs used with the JAX-RS? ...

Publishing messages to a JMS server on another machine ....

Hi, I need to publish messages to a topic on a JMS server running on a different machine. The server on the remote machine is Glassfish v3 (OpenMQ). From reading other posts here, I think I need to tell the remote broker to accept JMS messages from a different IP than his own i.e not localhost. Actually, I'd like that remote broker to a...

Java EE 6 - Embedded container EJB tests

This questiong is regarding Java EE 6, using glassfish v3 embedded-all. I have a unit test that uses EJBContainer to test my stateless EJB. Problem is I'm having trouble looking up the EJB (remote) using JNDI: setup() { ctx = EJBContainer.createEJBContainer().getContext(); } ... test() { BookService bookService = (BookService)ct...

Any way to inject/choose datasource at runtime?

I have a MySQL database with many databases, each named for a specific customer. A webapp is deployed per customer. The name of the webapp determines the underlying database name. When the webapp starts up, I have a modified Spring PropertyPlaceholderConfigurer to grab the ServletContext if it can and determine the name. I then derefere...

ejb 3.1 config schedule without hard coded

Hi! How can I configure a schedule intervals (@Schedule(persistent=true, minute="", second="/5", hour="*") ) outside from application: How can I configure it in ejb-jar.xml? Can I configure it outside from application (kind of properties file)? Thanks! ...

Logging from EJB module in JavaEE, maven configuration

I have tried for hours to get my project working but the EJB part is still failing with a java.lang.ClassNotFoundException: org.slf4j.LoggerFactory (I want to output some log in my EJB). The layout of the project is the following: |-- nnWeb-ear | |-- pom.xml | `-- src | `-- main | |-- application | | `-...

Do I need to use @Remote when I want to expose an EJB to a different application on same app server?

I have a @Stateless @Local Bean successfully deployed in an ear. I can see the new EJB 3.1 standard global JNDI name when I browse the JNDI tree. (java:global/product/product-ejb/ProductManagement) I want to use this EJB in a different application on the same app server. Do I need to add a remote interface for this EJB? ...

JMS onMessage() and concurrency ....

I have a stand-alone JMS app that subscribes to several different JMS topics. Each topic has its own session and onMessage() listener. Each onMessage() method updates a common current value table - all the onMessage() methods update the same current value table. I've read that the onMessage method is actually called on the JMS provider'...

What's the best way to mix Spring MVC and CDI/JEE6?

I'm not a fan of JSF. Spring MVC makes a lot of sense to me and I've used it in the past. Can you talk me out of it or provide tips for integrating it nicely into JEE6 and share and gotchas with CDI. I don't mind having an application context just for the MVC stuff but if I use @Inject or @EJB in my MVC controllers, what's going to go ...

Debugging transactions in Java EE

I have an @Stateless EJB method in which I delete some entries from a database using JPA remove()'s throw an Exception that is annotated as @ApplicationException(rollback=true) I have no other transaction-specific annotations for the method (I set @TransactionAttribute(TransactionAttributeType.REQUIRED) but that should be the defau...

Why does Eclipse not deploy dependency to Glassfish?

I am using Eclipse Helios, Glassfish 3.0.1 (Full Platform) and myfaces 2.0 . There a two projects in the workspace: A simple Java project (=> JP) and a dynamic web project (=> WP). I added JP to the classpath of WP. I added one class from JP as a managed bean to the faces-config.xml file of WP. <managed-bean> <managed-bean-name>m...

Stateless EJB JPA Error

My project is based on Netbeans 6.9 ,JEE 6 Web Application with Stateless EJB, REST Services. There is a big problem while doing the transaction. 1) Using JPA: JPA is not pushing the values to the db table after persist/flush. But entity ID is populated. I'm not able to the same db - entity in the other application. Ideally it should pu...

Do I need frameworks to complement a Java EE 6, JSF-2 Web-App? Which ones?

In the previous J2EE versions, it was common practice to complement the default libraries with frameworks like Spring, Hibernate, Struts, etc. Java EE 6 seemed to close the gap (with CDI, JPA, JSF2.0, etc.) - should I still use additional frameworks (Seam? A faces library? Spring?) I am currently using the default Oracle stack - Glass...

java ee6 security - use user entity class

All I need is a simple login page that will check against the username and password of a simple User entity class. Is that possible with JAVA EE6? In the tutorials they always store the users on the glassfish server. ...