java-ee

Glassfish JPA: Problems injecting EntityManager

Hi I am new to Java EE. I tried to get some first examples running (JPA). I am using Glassfish v3. The trouble is that I don't get the App Server injecting the EntityManager. Hear is one example http://www.adam-bien.com/roller/abien/entry/ejb_3_persistence_jpa_for which I extended with a JSP client. Entity: package beans; import ...

With JavaEE6, do we still need Spring, Hibernate or other frameworks?

Question as stated on title. Thank you. ...

Many WAR's and one common operation

Hi, I have to modify content of many WAR start pages to add some functionality. I can't use filters to modify cause filter needs to be placed in Web Archive. The same with servlet etc. Any clue how to do this? ...

How to write a Spring/JavaEE/web application installer?

I am in the process of converting a legacy system into a Spring JavaEE application and have gotten stuck trying to design the install process. Basically when the application starts up, it needs to check whether the database schema exists and other settings and prompt the user to set them step-by-step until everything is setup. (User is a...

GlassFish v3 Domain Server cannot start. Port is occupied.

I imagine this is a pretty generic error. I cant seem to find any documentation on it. I am simply attempting to run a java web project with jsp's and beans... using netbeans 6.8 on windows xp. Thoughts? apologies for such a newb question. -Kirb ...

java ee server similar to cassini

I primarily use Tomcat and Glassfish for Java EE development at work, but was wondering if anyone knew of any small application servers like Cassini for ASP.NET that would make building and testing faster? I would still eventually deploy to one of our production tomcat/glassfish servers, but would prefer something that is simpler and qui...

Is there a "Socket Connection Pool" of sorts for Java EE apps?

I'm writing a JAX-RS web service. It responds to client invocations by: Retrieving some info from a database Making a call to an external server For 2) the server does not expose a web service interface (i.e. no WSDL interface or REST API). Instead, it uses a custom protocol over TCPIP. I'd like to make client calls from my JAX-RS re...

[OT a bit] Flex+JEE what is it good for?

Ok so sorry for being, I guess, a bit off topic but still I think this is the best place to ask. My new semester just started (don't worry I won't ask you to do my homework) and this time we have a rather cool subject about www programming in general where we have to do a web service, web abb - whatever as long as it's "web". Here's the ...

Configuration of the Endpoint address for the access to the Wsdl in jax-ws

Hi all, I'm a newbie in web services with jax-ws and I'm a little mixed up with the different files. I'm doing a simple hello test and I'm trying to explain something. I successfully installed my web service on Glassfish. I also tested it with a standalone javaoutside the server) My example comes from the helloservice in the javaee5 tu...

using http request parameters in spring mvc

I am generating a table of data from a simple list of objects that I am displaying in a jsp page. Each row has a View hyper link attached to it. When the user clicks on the hyper link I need to send them to another controller (hooked up via a bean) to display more detailed information. I am trying to pass a unique id but in the controlle...

hot deploying simple application in jetty

I am working with jetty hightide vesion 7 currently as a stand alone server. I have a simple web project with a couple of jsp's and backing classes that I am currently deploying in an unexploded war to the JETTY_HOME/webapps directory. Currently, jetty easily picks up any static jsp/html changes. If I understand correctly, I can configu...

Online java training

I am looking for online webbased/CBT training/self study training videos for Java EE related technologies like Struts, JSF, JPA, Websphere, Spring and Hibernate. I'm using learndevnow for Microsoft related technologies. It's really good, I am looking for similar thing for Java EE. Any suggestions please? ...

Structure of a Java Web Application in Eclipse

I have developed various Java EE web-applications in Netbeans by selecting webapplication as the project type. Now, I want to start coding a web-application in Eclipse. The application will be based on Struts framework. The structure of the project created by Netbeans and Eclipse are different. Q1. What project type I should choose fo...

Optimizations employed by ORM's

I'm teaching JEE, especially JPA, Spring and Spring MVC. As I have not so much experience in large projects, it is difficult to know what to present to students about optimisation of ORM. At the present time, I present some classic optimisation tricks: prepared statements (most of ORM implicitely use them by default) first and second-...

Login not triggered for restricted page in glassfish jdbcrealm authentication

I'm very new to EJB security and GlassFish authentication, authorization mechanism. I have a jdbc realm and configured sun-web.xml and web.xml to map the roles and restrict access to a page. However, my problem is that when I restrict access to all the pages, it works and triggers the login pop up before loading the welcome page (using ...

What exceptions are thrown by JPA in ejb containers?

I am developing an EJB application to run on glassfish v3. If I look at the javadoc for the EntityManager class it says that methods like find, persist etc throw exceptions derived from PersistenceException. However, in practice I notice that exceptions derived from org.eclipse.persistence.exceptions.DatabaseException can be thrown if so...

Eclipse, how to combine 2 editions

I'm using the PHP edition of Eclipse, but was told that I also need the JEE edition. I'd like to install them both in the same install (single launch) and not have to open 2 editions in parallel. Is there a way to easily get this done? I'm new to eclipse, so detailed instructions are welcome. ...

Is it okay to pass injected EntityManagers to EJB bean's helper classes and use it?

We have some JavaEE5 stateless EJB bean that passes the injected EntityManager to its helpers. Is this safe? It has worked well until now, but I found out some Oracle document that states its implementation of EntityManager is thread-safe. Now I wonder whether the reason we did not have issues until now, was only because the implement...

Fastest way to learn Flex and Java EE?

Ok so me and my 2 friends have to make a webapp and well we think it's a good opportunity to learn JEE and Flex. The thing is we have very little knowledge about them and we have only 3 months to do it (it doesn't have to be super complicated). So my question is: what, in your opinion, would be the fastest way to learn them both? I guess...

use of EntityManagerFactory causing duplicate primary key exceptions

Hey guys, my goal is create an EntityManager using properties dependent on which database is in use. I've seen something like this done in all my Google searches(I made the code more basic for the purpose of this question): @PersistenceUnit private EntityManagerFactory emf; private EntityManager em; private Properties props; @PostCon...