Using Java's java.util.Calendar

I am trying to use the following like so.

property name=“calendar” inject=“javaloader:java.util.Calendar”;

The idea is that I can use this object to do some data conversion, the problem is that when I try to use it I am getting the below error. So the question is how can this work, I tried using



myCal = calendar.init();

But that gives an error saying it can’t find a constructor with init(‘’), but the javaDocs say there is a default constructor Calendar() so can anyone help in explaining what I am doing wrong here. As you can tell I don’t use JavaLoader much so I am not sure what is going wrong.

Application Execution Exception

Error Type: Object : [N/A]
Error Messages: Object instantiation exception.
An exception occurred while instantiating a Java object. The class must not be an interface or an abstract class. If the class has a constructor that accepts an argument, you must call the constructor explicitly using the init(args) method. Error : Class can not access a member of class java.util.Calendar with modifiers “protected”


Andrew Scott

why are you using javaloader for that?

Is it a library you are classloading? java.util.Calendar is part of the jDK, just map it in wirebox

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager:

Hmm, the Docs indicate I could. And if I call JavaLoader before creating that file it works. But restart the server and it doesn’t.

What are the advantages over maping it with WireBox? That seems like unnecessary work for me.


Andrew Scott