I create an Enterprise Application CustomerApp that also generated two projects CustomerApp-ejb and CustomerApp-war. In the CustomerApp-ejb, I create a SessionBean call CustomerSessionBean.java as below.
package com.customerapp.ejb;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;
import javax.persistence.EntityManager;
import j...
Hi!
Where can I find the source code for isUserInRole? All I find are only interfaces or calling to super.isUserInRole
...
How can I use JSR-299 CDI to inject (not annotated) beans from external libraries?
Examples:
Interface X and its implementations come from a third party lib. How can I decide which implementation to use?
class A {
@Inject
private X x;
}
What if I had several classes using the X interface but different implementations?
cl...
Tools like BaseCamp, FogBugz & Jira have features where you can send an email to the server on a special address, and it will monitor this address and respond to mails received... e.g Jira let's you create a new bug-report by email, BaseCamp will append an email to a discussion thread, even figuring out the right thread based on the emai...
I'm trying to learn Java EE 6 and i'm just wondering how to implement authentication mechanism in Java EE 6.
Here is the Java EE 6 authentiction example:
public void login() {
if (account.authenticate(name, password) == null) {
message = "Invalid user name or password!";
} else {
message = " Login successfu...
I am in the process of trying to untangle the (of course uncommented) code of a contractor that preceded (and I don't have access to currently) me at my current gig and I came across three pieces of code that I found odd and was hoping someone might clue me into why this might have been done, since I can't come up with any valid reason f...
We have switched to JBoss 6 to make it possible to use a wider range of Java EE technologies. We chose JBoss because of its small memory footprint compared to other application servers, so we have no other choice.
Do you know any developer tools that can be integrated with JBoss AS 6?
Thanks in advance
Jonathan Frank
...
I am new to JTA and it's underlying transaction managers. Can anyone explain the pros/cons of each of these? Feel free to add others I didn't list in title.
Also, don't the major applications servers (WebSphere, JBoss, Glassfish) have their own JTA compliant transaction manager? In those environments, would you still use these third p...
Hello, experts!
I am trying to create instance of class javax.servlet.ServletException with following code
public class MyTroubleViewer {
public static void main(String[] args) {
javax.servlet.ServletException servletException = new javax.servlet.ServletException("Hello");
System.out.println(servletException.getMessage());
}
}
...
By default DB connections of JPA applications are configured in the META-INF/persistence.xml, when the application is not deployed to a full Java EE application server. In my opinion it is not very elegant to place such environment specific configuration into a file that is inside a .war file. How could a DB connection of a Servlet based...
BOSH (Bidirectional-streams Over Synchronous HTTP) is a sneaky way of implementing 2-way client-server communication in situations where true server-push is not allowed, most obviously to let a server push data to a browser client without having to use client polling.
It works by the client sending a request to the server, and the serve...
Hi,
We are using JSF in UI, Spring in business layer, Hibernate in persistence layer. Now my question is how to pass data from the JSF UI to spring business layer. Can I directly use my business object in my backing bean or should I transfer data between the layer through DTO? Can one explain me with clear explanation if possible with p...
Hi guys,
I have a simple question, but I can't find out the answer. I'm wondering if we can see that a website is built using the JEE technology, or servlets/JSP. I think it could be possible to look for specials pages from the server (404, wrong parameters, ...) in some cases, but what about the everyday use ?
In fact, I look for a co...
Hi guys,
I have a EJB module in remote Glassfish server and application client in my computer. I want to connect from the application client to the remote EJB.
Here is the my EJB interface:
@Remote
public interface BookEJBRemote
{
public String getTitle();
}
Here is the my ejb:
@Stateless
public class BookEJB implements BookEJ...
I would like to use RESTful services in a CDI/JSF2 application. I am not very familiar with JAX-RS however I have read that its lifecycle does not play well with CDI/JSF2. Is it possible to incorporate JAX-RS with CDI/JSF2 in a JEE6 stack? If not are there alternatives?
thanks
...
The spec says "Acknowledging a consumed message automatically acknowledges the receipt of all messages that have been delivered by its session" - but what I need to know is what it means by 'delivered'.
For example, if I call consumer.receive() 6 times, and then call .acknowledge on the 3rd message - is it (a) just the first 3 messages...
Hello,
I'm looking for an entry point in an EJB deployed on JBoss.
Servlets have the load-on-startup tag to use in its web.xml.
I'm searching for similar init() functionality for an EJB.
...
If I understand correctly the default JNDI service runs on my local AS, right? So if I create an EJB and in jboss.xml (running JBoss) I name it "sth" than it is registered in my AS. Correct?
In big projects EJBs might be distributed through many servers - on one server EJBs doing sth and on another sth else. When calling JNDI loopup() I...
I am brand new to the JEE world. As an exercise to try and familiarize myself with JEE, I'm trying to create a tiered web-app, but I'm getting a little stuck on what the best way is to spin up a service in the background that does work.
Parameters of the service:
It must open and hold a socket connection and receive information from t...
I want to create a Producer that makes it possible to inject a java.util.ResourceBundle into any class in order to get localized Strings easily. My ResourceBundle-Producer looks like this:
public class ResourceBundleProducer {
@Inject
public Locale locale;
@Inject
public FacesContext facesContext;
@Produces
p...