What are good InstallAnywhere replacements for installing a Java EE application?

In this case, unfortunately, SO didn’t tell us much that we didn’t know already (and indeed the tool we ultimately chose was not mentioned in any answer). However, I’m posting our experiences here, as they might be helpful to others later on. We (quickly) evaluated the following installer tools, mostly by looking at their websites … Read more

What is meant by abstract=”true” in spring?

Abstract beans in Spring are somewhat different from abstract classes. In fact, abstract bean in Spring doesn’t even have to be mapped to any class. Take this as an example: <bean id=”dao” abstract=”true”> <property name=”dataSource” ref=”dataSource”/> <property name=”someHelper” ref=”someHelper”/> </bean> <bean id=”fooDao” class=”FooDao” parent=”dao”> <property name=”fooHelper” ref=”fooHelper”/> </bean> <bean id=”barDao” class=”BarDao” parent=”dao”> <property name=”barHelper” ref=”barHelper”/> … Read more

Why is Java frequently used for enterprise applications? [closed]

One word: libraries. Java has an vast array of excellent libraries for solving most of the common problems one needs to solve when developing enterprise applications. In many cases, there is more than one good choice for addressing a particular need, and oftentimes those libraries are free and open source under a business-friendly license. Some … Read more

How to read request.getInputStream() multiple times

Working code based on the accepted answer. public class CustomHttpServletRequestWrapper extends HttpServletRequestWrapper { private static final Logger logger = Logger.getLogger(CustomHttpServletRequestWrapper.class); private final String body; public CustomHttpServletRequestWrapper(HttpServletRequest request) { super(request); StringBuilder stringBuilder = new StringBuilder(); BufferedReader bufferedReader = null; try { InputStream inputStream = request.getInputStream(); if (inputStream != null) { bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); char[] … Read more

Java EE Architecture – Are DAO’s still recommended when using an ORM like JPA 2?

If I’m using an ORM like JPA2 – where I have my entities that are mapped to my database, should I still be using a DAO? It seems like a lot more overhead. It is. And clearly, Java EE doesn’t encourage using the DAO pattern when using JPA (JPA already provides a standardized implementation of … Read more

Java for C# developers

The language itself should be simple to understand. There are not as many language constructs, everything possible is done in libraries. The libraries will take some getting used to. The two most critical things you can do to hit the ground running is: 1: Use NetBeans or Eclipse and hit ctrl-space ALL THE TIME. It’s … Read more

Where to Download java-ee.jar?

Sun/Oracle is providing a java-ee.jar – which contains only the Java EE APIs and does not contain any method bodies – that you can use to compile against it (from the java.net maven repository): For Java EE 5: http://download.java.net/maven/1/javaee/jars/javaee-api-5.jar For Java EE 6: http://download.java.net/maven/2/javax/javaee-api/6.0/javaee-api-6.0.jar If you want to execute some Java EE code, you’ll need … Read more

Configure JPA to let PostgreSQL generate the primary key value

Given the table definition: CREATE TABLE webuser( idwebuser SERIAL PRIMARY KEY, … ) Use the mapping: @Entity @Table(name=”webuser”) class Webuser { @Id @SequenceGenerator(name=”webuser_idwebuser_seq”, sequenceName=”webuser_idwebuser_seq”, allocationSize=1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator=”webuser_idwebuser_seq”) @Column(name = “idwebuser”, updatable=false) private Integer id; // …. } The naming tablename_columname_seq is the PostgreSQL default sequence naming for SERIAL and I recommend that you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)