Category Archives: Java

Configure JMS-AddressList property in Glassfish dynamically [Update]

When you would like to use a scenario like “Consuming JMS-Messages from a remote server” (see here), you may explore very quickly the problem, which comes with this example: The hard-coded “AddressList” property. This is a problem, because it reduces the resuability to null. Testing or deploying on other system configurations would lead to code […]

 

1
Kudos
Don't
move!

Read more

[Updated] Using JUnits-@Rule for injecting EntityManagers during testing

Hi! Today I would like to show you, how to use a JUnit-Rule for setting up and injecting a EntityManager during testing. First we need at least JUnit version 4.10 and JEE6. I will use EclipseLink as a persistence provider, but you can choose whatever your preferred persistence provider is. The next step, after creating […]

 

0
Kudos
Don't
move!

Read more

@Resource.lookup – How to solve classpath problems when compiling or testing with gradle

I’ve started this week with Gradle and tried to convert one project from maven to Gradle. Besides of some, I think beginner mistakes, I faced with the following problem. With JEE6 the @Resource annotation was extented with the “lookup” attribute. This attribute links to any resource which uses a global JNDI name. Something like this: […]

 

1
Kudos
Don't
move!

Read more

Using hot-deploy with Netbeans and Glassfish

One of the nice features, when you were using Netbeans 7.x and Glassfish 3.x, is the hot-deploy feature. This means, when you change a class or web-page, after saving the file is compiled (if required) and directly deployed to the deploy-location of your project. This can save a lot of time, because you had not […]

 

5
Kudos
Don't
move!

Read more

CDI: SessionScoped-Bean must be passivation capable

Due to some questions about Session/ConversationScoped managed beans in CDI I answered during the last days I decided to wrote a little post about it. Another reason was that there seems to be no information about that issue (except of the origin specification 😉 ). Nearly every single question was around the error message “WELD-000072” […]

 

8
Kudos
Don't
move!

Read more

Tutorial: JUnit-Rule

Hi, as announced, here is the short tutorial for writing your own JUnit-Rule. JUnit provides with the @Rule and @ClassRule annotations a powerful way to reduce the boilerplate code for setting up structures / assumptions. It also removes, in the most cases, the requirement of using inheritance and replaces it with composition. Short overview A […]

 

2
Kudos
Don't
move!

Read more

Java EE 6 Tutorial installieren

Um einen ersten Einblick in die Welt des Java EE 6 zu erhalten beziehungsweise um mich, habe ich gestern angefangen das Tutorial von Java EE 6 durchzuarbeiten. An dieser Stelle kamen meine Bemühungen jedoch in’s Stocken. Das GlassFish Update Tool stellte mir, entgegen der Ausführungen in dem Artikel, keinerlei Optionen für den Download der Beispiele […]

 

0
Kudos
Don't
move!

Read more