Archive for May, 2009

Google I/O 2009

Thursday, May 28th, 2009


Here’s a brief update of Google I/O.  Lots of good content at the conference.

Day 1

  • Keynote – HTML 5 (Canvas, GEO Location, Webworkers and two others I can’t think of).  Support or planned support on all browsers (Firefox, Chrome, Safari, Opera)  except Internet Explorer.  I remembered the two other things — how could I forget:  Video and Threading! App-Cache.
  • Android Developer Challenge #2 announced.  Only 1.9 Million allocated (they previously had $5M bucks).  But everyone at the conference got a free Android Phone (HTC Dream).   Now I don’t have to replace my blackberry right away.  It’s really sweet!.
  • Mobicodes (QR Codes) are hot at the conference — scanned with the camera and capable of holding 4K of data.  Used on the badges and used on the Scavenger Hunt.  Wish I realized that the codes at the session feedback were included — because they were 20 points each :( .
  • Hooked up with the Android dev guys to talk to them about writing an app for Android  (now that I have a kick ass phone).
  • After putting our lives at risk trying to get to Tommy’s Joynt, we decided to grab some Italian food closer to the hotel.  Tommy’s Joynt is probably a lunch visit (during the daytime).
  • All the codenames for Android are bakery products:  Cupcake, Donut, Eclair.  I hope they serve up some Ho-Hos.  Mmmm.

Day 2

  • The Lego Guy – incorporating developers into process — first devs hacked the Mindstorm and Lego freaked out — then invited them in to participate in development.  Ultrasonic sensor was the result.
  • Keynote – The Google Wave – Google’s interpretation of a server/network based mechanism for collaboration.    Solves some of mails problems (like trying to figure out where you are in a thread and bringing people into the context).  Realtime editing by multiple users.  Uses OpenSocial for gadgets to integrate other sites (e.g. blogs).  Incorporates Wiki like functionality,
  • Questions:  how will it integrate with Mail?  It appears that will be up to the developers to figure out.
  • Android Game Development session was very crowded … probably because the Wave Programming session was following it up.  Canvas is slow for drawing sprites.  OpenGL draw_texture is the clear winner for drawing sprites.
  • Wave Coding — looks like being a google apps reseller would be great if you get paid for Wave too.  Robots are hosted on AppEngine.

JasperAssistant supporting a newer version of JFree Charting

Friday, May 15th, 2009


I had a problem where I was coding a Chart Customizer to a newer version of JFree Chart than was in JasperAssistant 3.0.1.

Here’s the JFree chart dependency:

<dependency>

<groupId>jfree</groupId>

<artifactId>jfreechart</artifactId>

<version>1.0.9</version>

</dependency>

 

I ran into this problem when trying to view the report in JasperAssistant:

Specifically:

org.jfree.chart.plot.PiePlot.getSectionPaint(LJava/lang/Comparable;)LJava/awt/Paint;

This error is caused by me writing my code to JFreeChart 1.0.9 when JasperAssistant is still using 1.0.0. I’m sure 1.0.9 supports the api in 1.0.0, but vice versa is not true.

Is there an easy way to update the JFreeChart version used? Can I update it myself?

 

I had tried to update the plugin dependency in eclipse\plugins\com.jasperassistant.designer.core_3.0.1\plugin.xml

and removed:

eclipse\plugins\com.jasperassistant.designer.core_3.0.1\lib\jfreechart-1.0.0.jar

and added:

eclipse\plugins\com.jasperassistant.designer.core_3.0.1\lib\jfreechart-1.0.9.jar

I ended up with:

java.lang.NoClassDefFoundError: org/jfree/chart/plot/PlotOrientation

at net.sf.jasperreports.engine.base.JRBaseChartPlot.<init>(Unknown Source)

at net.sf.jasperreports.charts.base.JRBasePiePlot.<init>(Unknown Source)

at net.sf.jasperreports.charts.design.JRDesignPiePlot.<init>(Unknown Source)

at net.sf.jasperreports.engine.design.JRDesignChart.setChartType(Unknown Source)

at net.sf.jasperreports.engine.design.JRDesignChart.<init>(Unknown Source)

at net.sf.jasperreports.charts.xml.JRPieChartFactory.createObject(Unknown Source)

at org.apache.commons.digester.FactoryCreateRule.begin(FactoryCreateRule.java:389)

at org.apache.commons.digester.Digester.startElement(Digester.java:1361)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:798)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:878)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)

at org.apache.commons.digester.Digester.parse(Digester.java:1647)

at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(Unknown Source)

at com.jasperassistant.designer.pJ.a(SourceFile:39)

at com.jasperassistant.designer.fF.b(SourceFile:105)

at com.jasperassistant.designer.fF.e(SourceFile:89)

at com.jasperassistant.designer.fF.c(SourceFile:82)

at com.jasperassistant.designer.editors.ReportEditor.setInput(SourceFile:451)

at com.jasperassistant.designer.ik.init(SourceFile:217)

at com.jasperassistant.designer.editors.ReportEditor.init(SourceFile:557)

at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:799)

at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:643)

at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:428)

at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)

at org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:262)

at org.eclipse.ui.internal.EditorPane.requestActivation(EditorPane.java:98)

at org.eclipse.ui.internal.presentations.PresentablePart.setFocus(PresentablePart.java:192)

at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:94)

at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:267)

at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:272)

at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.handleMouseDown(AbstractTabFolder.java:342)

at org.eclipse.ui.internal.presentations.util.AbstractTabFolder$3.mouseDown(AbstractTabFolder.java:79)

at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:179)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)

at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)

at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)

at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)

at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

 

To get around this problem I just renamed:

eclipse\plugins\com.jasperassistant.designer.core_3.0.1\lib\jfreechart-1.0.9.jar

to:

eclipse\plugins\com.jasperassistant.designer.core_3.0.1\lib\jfreechart-1.0.0.jar

and left the plugin.xml the way it was originally.

It works.  Woot

SpringSource’s Roo

Sunday, May 10th, 2009


Roo looks like it aims to eliminate/reduce some of the complexity with the setup of an Java application. I tried my hand at the vote and petclinic application by following the instruction in the readme. I ran into a problem with deploying the app to my local tomcat 6 instance. Roo uses the Hibernate EntityManager, but for some reason, I’m getting these errors.  I would have thought that this example would have worked right out of the chute.

I found that from http://forum.springsource.org/forumdisplay.php?f=67 I could run mvn package and get it to run correctly under Tomcat.  It appears to be a problem with the AspectJWeaving.

 

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.springsource.vote.domain.Choice
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:288)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:103)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1238)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1006)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:412)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:383)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:271)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:268)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:469)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:717)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:376)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:254)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:198)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.springsource.vote.domain.Choice
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1332)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:412)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:383)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:271)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:268)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:282)
... 32 more
Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.springsource.vote.domain.Choice
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:671)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:534)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:286)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1121)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1225)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:159)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:425)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1363)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1329)
... 41 more
May 10, 2009 9:10:51 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
May 10, 2009 9:10:51 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/vote] startup failed due to previous errors
Hibernate EntityManager 3.3.2.GA
Processing PersistenceUnitInfo [
name: persistenceUnit
...]