Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Saturday, 8 December 2007

SSH access to Joyent

This hopefully the first of a few posts on the general topic of Facebook application development with Java using the free hosting provided by Joyent.

I've setup cygwin for remote access to my joyent account. I followed this tutorial to configure SSH with no password to ease the hassel of logging into the server.

Friday, 7 December 2007

Installing Java JTP into Maven

First download the Java Transaction API
Classes 1.0.1B zip.

And then run this maven command to add the zip to the local repo.


mvninstall:install-file-DgroupId= javax.transaction
-DartifactId=jta
-Dversion=1.0.1B-Dpackaging=jar-Dfile=jta-1_0_1B-classes.zip

Friday, 21 September 2007

Java Persistence API

Java Persistence API

Trying to get JPA and derby working together with jdk 5 SE.

JPA with a Derby DB

Rehash of the JPA tutorial

Hibernate as JPA provider

Wednesday, 25 July 2007

java.lang.IllegalAccessError: tried to access method junit.framework.TestCase.()V

Seems this error happens when running ANT 1.7 and JUnit 3.8.1. The quick solution is upgrade junit to 3.8.X.

The cause as i can make out at this time is this. The junit task in the ant script forks a new jvm which creates a new classloader, this correctly picks up the junit 3.7.1 jar. Between 3.7 and 3.8.1 junit changed the default method name for getting the test name, from name() to getName(). ANT 1.7 in this case, first checks the junit version and then attempts to use reflection to call the correct test name method, but since the Task class has a protected constuctor method and there is a new classloader this IllegalAccessError is thrown.

The method name change is correct, the reflection stuff is correct but the classloader stuff is probally smack.


C:\Develop\UIClaims50_PeriodicBuilder\UI\UITools\components\cruisecontrol\projects\build-ant.xml:94: The following error occurred while executing this line:
C:\Develop\UIClaims50_PeriodicBuilder\UI\EJBServer\ant\uiclaims.junit.xml:43: java.lang.IllegalAccessError: tried to access method junit.framework.TestCase.()V from class org.apache.tools.ant.taskdefs.optional.junit.JUnitTaskMirrorImpl$VmExitErrorTest
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:541)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
...
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: C:\Develop\UIClaims50_PeriodicBuilder\UI\EJBServer\ant\uiclaims.junit.xml:43: java.lang.IllegalAccessError: tried to access method junit.framework.TestCase.()V from class org.apache.tools.ant.taskdefs.optional.junit.JUnitTaskMirrorImpl$VmExitErrorTest
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:115)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
... 16 more
Caused by: java.lang.IllegalAccessError: tried to access method junit.framework.TestCase.()V from class org.apache.tools.ant.taskdefs.optional.junit.JUnitTaskMirrorImpl$VmExitErrorTest
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTaskMirrorImpl$VmExitErrorTest.(JUnitTaskMirrorImpl.java:80)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTaskMirrorImpl.addVmExit(JUnitTaskMirrorImpl.java:55)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.logVmExit(JUnitTask.java:1446)