java-ee-6

django-like CRUD generation with JAVA EE6?

Hey! I just checked out the Netbeans tutorial for auto-generation of CRUD pages. Not bad, but is there any way to generate CRUD pages with Java EE that look a bit more production like? For example like the admin interface generated by Django or Spring ROO. Of course basic features like searching or alphabetic ordering should be included...

Good JavaEE book?

Possible Duplicates: Best Java book you have read so far Could you please suggest any good books for Java EE J2EE Book Recommendation Assuming I already know the JavaSE basics, what would be a good JavaEE book? ...

Hibernate returning no results show this error INFO: Not binding factory to JNDI, no JNDI name configured

I am using JPA with hibernate and trying to connect to the a datasource to retrive information but when i run the application i get no error as such but no results are displayed when i run the following code.The question arose from a previous post located here when I was setting up the environment to do some testing of JPA with hibernate...

Problem initializing backing bean property in constructor

Hello, I have managed bean/backing bean and I inject there (with @EJB) session bean. Now in constructor I want to use it to initialize property in backing bean with value from database. But injected session bean is null. What are the other ways to initialize? As far as I know I can't use @PostConstruct because fetching data from databas...

CDI injectionpoint @httpparam problem

I follow the Weld's doc in the section 4.11. The InjectionPoint object There is a very interesting example about how to obtain the http parameter using CDI but i copy-pasted the code into netbeans, everything compiles, but has an deployment error Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Injection point ...

EntityManager not fetching from database?

Hello, I have entities: Post, User, Comment with bidirectional relationships: --------- 1 * --------- | Post | <--------> |Comment| --------- --------- --------- 1 * --------- | User | <--------> |Comment| --------- --------- I have simple page which displays single post and all its comments and...

Configure Interceptor to be used for ALL CDI-Beans inside an application

In my JEE6-CDI-webapp, i declared a Security Interceptor, like this one: //Secure.java @Inherited @Target({TYPE, METHOD}) @Retention(RUNTIME) @InterceptorBinding public @interface Secure {} //SecurityInterceptor.java @Secure @Interceptor public class SecurityInterceptor { @AroundInvoke protected Object invoke(InvocationContext ...

Can I define relationships in an Entity class without having them in the database?

Hi, I have to write an application in Java EE6. I have been given a MySQL database, to which I am not allowed to make any changes. The database is well structured and normalized, but does not have any foreign keys defined to enforce integrity. (It uses the MyISAM engine). Is it possible to define relationships (using @JoinColumn, @Many...

EJB testing strategies?

I'm working on a Java EE 6 application. When I started out, I was writing tests for my EJB classes by manually instantiating the EJB, then manually adding the members that normally get provided by dependency injection. As the application gets more complicated, I find that this approach just doesn't cut it. So I'd like to be able to start...

How can i use serializable transactions on JEE 6?

I am learning the new annotations for transaction management, like @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW), but i could not find out how to create a transaction with SERIALIZABLE isolation. Is this possible on a per-method basis or i have to set it on the connection for the whole application? ...

CDI Activate producer packaged in jar

i have a producer, i want to put it in a jar, so that my diff war files can refer the same implementation public class LogFactory { @Produces public Logger createLogger(InjectionPoint injectionPoint) { return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName()); } } but it turns now, glassfish (3.0.1) ...

h:messages gives no output

Hello, I'm learning about bean validation. I have created simple form with username and password input fields which are bound through backing bean to model (User) properties username and password. I have marked them with annotation: @Id @NotNull(message="Username cannot be empty") private String username; @NotNull(message="Password can...

Using CDI + WS/RS + JPA to build an app

@Path(value = "/user") @Stateless public class UserService { @Inject private UserManager manager; @Path(value = "/create") @GET @Produces(value = MediaType.TEXT_PLAIN) public String doCreate(@QueryParam(value = "name") String name) { manager.createUser(name); return "OK"; } } here is the u...

EE 6 (GlassFish): how many containers? How many singletons?

Ok, still trying to understand the basic EE 6 concepts here. I'm hoping someone here can help me out. I'm running GlassFish v3 server Kukla with a single domain. I deploy MyEEApp.ear, which contain MyEEWebApp.war, MyEJBs.jar, and, MyUtilityLibrary.jar. My EJB jar contains a @Singleton bean called MySingleton. I then set up another serv...

Best way to run a command-line application that uses code running in an EE 6 environment? (GlassFish v3, MyEclipse 8.6)

Ok, back for another complicated question, I'm afraid. Please be patient: this is a lot of new stuff for me. Back in the dark ages, we were running a Frankenstein of an application on WebLogic. When we decided to move things to GlassFish v3, we all agreed that the time was nigh to do things the "right" way, from an EE 6 perspective. To...

How to mange dependencies for a Glassfish JavaEE client application?

JBoss has the jbossall-client.jar which can be used in client applications for JNDI lookups and more... It is available in the JBoss maven repository. How should one do it when using Glassfish 3 in a dependency managed environment? The FAQ says in step 3 that one should refer directly to gf-client.jar in the installation directoy of gl...

Retry login with form based container managed security

I've got a web application, deployed on GlassFish 3.0.1, which is using container managed security. It's a simple, standard form based implementation using j_security_check against a JDBCRealm. Everything to do with securing the application is fine (and I can't believe I've rolled my own security systems in the past). What I can't seem ...

RESTful Web Development With Java EE 6 - what are the options?

I'm trying to figure out what the best options are for developing a RESTful web application with Java EE 6. For example, I want to be able to interpret a URL like so: GET www.myapp.com/customers/1 - returns a web page displaying details about a customer with id 1. The only two options I can think of are Using Spring MVC 3 Using a JAX...

Why session bean method throw EjbTransactionRolledbackException when RuntimeException was thrown

Hi All! I am trying to persist the entity with constraint validation, when invoke persist - there is constraint that thrown and the caller get EjbTransactionRolledbackException... so I try to call the validation explicit and throw ConstraintViolationException/RuntimeException and still the caller get EjbTransactionRolledbackException......

How to send mail via ejb 3.1 annotations based

Hi All! I am trying to inject javax.mail.session in ejb 3.1 via @Resource without any success, I believe that I miss understood the proper configurations (I want annotations based solution and not XML descriptor) I read in the new spec of JEE 6 and understand that I can used in the new JEE 6 Connector API to send mails via Message Driv...