Javaloader Error on Shared host

65 views
Skip to first unread message

ortho

unread,
Jan 2, 2012, 6:52:06 PM1/2/12
to javaloader-dev
I am using javaloader 1.0 on a local xp box with coldfusion 9.0. I
have been using it to load Bcrypt (http://www.mindrot.org/projects/
jBCrypt/) and it works fine with the code at:
http://blog.mxunit.org/2011/02/hashing-passwords-with-bcrypt-in.html:
============================
pw = "happy1.!gIlm0re";

jbClass = expandPath("jBCrypt-0.3");
javaloader = createObject('component', 'javaloader.javaloader');
javaloader.init([jbClass]);

bcrypt = javaloader.create("BCrypt");

hashed = bcrypt.hashpw(pw, bcrypt.gensalt());
===================================
I have now installed it on a shared server at our coldfusion host
(Newtek, formerly Crystaltech) with Windows and Coldfusion 9. Again it
works fine until I do not use the default salt work factor, i.e.,

Works with:
hashed = bcrypt.hashpw(pw, bcrypt.gensalt());

but not with
hashed = bcrypt.hashpw(pw, bcrypt.gensalt(10));

I get a coldfusion error from javaloader when the non-default argument
is used:
Could not find the designated method
Could not find the method 'gensalt' in the class BCrypt The error
occurred in
D:\Inetpub\................SupportFiles\javaloader\JavaProxy.cfc: line
351
Called from D:\Inetpub\..............SupportFiles\javaloader
\JavaProxy.cfc: line 253
Called from D:\Inetpub\..............SupportFiles\javaloader
\JavaProxy.cfc: line 158
Called from D:\Inetpub\..............\SupportFiles\javaloader
\JavaProxy.cfc: line 80
Called from D:\Inetpub\..............\SupportFiles\test_bcryptJL.cfm:
line 34
349 : <cfargument name="message" hint="The message to accompany the
exception" type="string" required="Yes">
350 : <cfargument name="detail" type="string" hint="The detail
message for the exception" required="No" default="">
351 : <cfthrow type="#arguments.type#" message="#arguments.message#"
detail="#arguments.detail#">
352 : </cffunction>
353 :

It may be why it is recommended to test in a shared hosting
environment when admins can turn things off! Anyway I'd appreciate any
insight -- I have the stack traceI could email to anyone.

Thanks.

Mark Mandel

unread,
Jan 2, 2012, 8:17:23 PM1/2/12
to javaloa...@googlegroups.com
What happens if you JavaCast it to the right data type, i.e. int/float etc?

Mark

MarkZ

unread,
Jan 2, 2012, 9:39:01 PM1/2/12
to javaloa...@googlegroups.com

Perfect! Thank you so much for helping. Never had any need to work with Java issues before. Most of the languages I have used often have no strict typing.

 

Ortho

 


Mark Mandel

unread,
Jan 2, 2012, 10:08:01 PM1/2/12
to javaloa...@googlegroups.com

No worries, glad you got it sorted.

Sent from my mobile doohickey.

Reply all
Reply to author
Forward
0 new messages