History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRVY-1718
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Ilya Sergey
Reporter: Mike Cantrell
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Groovy

Broken JCE with latest JetGroovy

Created: 26 Aug 08 19:59   Updated: 28 Aug 08 19:22
Component/s: Grails other
Affects Version/s: jetgroovy 1.6
Fix Version/s: jetgroovy 2.0, jetgroovy 1.6

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Zip Archive cryptoTest.zip (238 kb)

Environment: Windows XP, java version "1.5.0_14", grails 1.0.3

Build: 18,593


 Description  « Hide
The following code works from Grails "Run Tests" and from the grails test-app command line:
import javax.crypto.spec.SecretKeySpec
import javax.crypto.Cipher

class CryptoTests extends GroovyTestCase {
	void testCryptoInit() {
		byte[] kbytes = "12345678".getBytes();
		SecretKeySpec key = new SecretKeySpec(kbytes, "Blowfish");
		Cipher cipher = Cipher.getInstance("Blowfish");
		cipher.init(Cipher.DECRYPT_MODE, key);
	}
}

However, if you put the same code in the bootsrap (or execute it anywhere else in the grails app), you get an Exception after starting the app with IDEA:

java.lang.ClassCastException: com.sun.crypto.provider.BlowfishCipher
	at javax.crypto.Cipher.a(DashoA12275)
	at javax.crypto.Cipher.init(DashoA12275)
	at javax.crypto.Cipher.init(DashoA12275)
	at BootStrap$_closure1.doCall(BootStrap.groovy:12)

This will NOT throw an error from the grails run-app command line. It seems to be isolated to IDEA.



 All   Comments   Work Log   Change History      Sort Order:
Mike Cantrell - 26 Aug 08 20:03
Where can I find an older build of the JetGroovy plugin? The SVN link is broken from the wiki site:

http://www.jetbrains.net/confluence/display/GRVY/How+to+build+plugin