I have some code which works under Railo, but am trying to get this particular app working on CF10 and CF11
It's a cfWheels app, and I've got a BCrypt.class
file in the /miscellaneous/
directory.
In my /events/onapplicationstart.cfm
file, I've got:
application.bCrypt = CreateObject( "java", "BCrypt", "/miscellaneous/" );
This works in Railo; but in CF11 I get
The java object type is unknown for the CreateObject function.
Verify the type of your object when creating it and try again.
Valid Types are : component | java | webservice | dotnet | com | corba | .NET
The error occurred in /Volumes/Documents/blah/public/events/onapplicationstart.cfm: line 8
Called from /Volumes/Documents/blah/public/wheels/global/cfml.cfm: line 111
Called from /Volumes/Documents/blah/public/wheels/events/onapplicationstart.cfm: line 388
6 :
7 : // BCrypt library
8 : application.bCrypt = CreateObject( "java", "BCrypt", "/miscellaneous/" );
9 :
10 : // Application Specific settings
I assume it's just a syntax thing? Can I call a .class file in this manner on CF10/11 ?
Ah thanks all. As haxtbh said in the comments, the problem was
Adobe CF's createObject only has two arguments. The type and the class.
So I needed to put:
this.javaSettings = { LoadPaths = ["/miscellaneous"] };
in /config/app.cfm
and then use
CreateObject( "java", "BCrypt" );
in /events/onapplicationstart.cfm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With