We're migrating to JBoss AS7 from an older version of JBoss and we use JFreeChart in one part of our app:
chart = ChartFactory.createStackedBarChart( "", "", "Data", dataset,
PlotOrientation.HORIZONTAL, true, false, false );
When we hit this line, we get the stack trace below indicating that com.apple.laf.AquaLookAndFeel can't be found. We only see this issue on a Mac which makes sense given the com.apple.laf package name. Running on a Linux server seems to work fine. Is there something we need to do to get AS7 on a Mac to recognize Apple's look and feel classes?
All of the Macs I've tried this on are fully updated as of 4/26/12. I haven't been able to find one that has some of the older JVMs.
Stack trace:
15:38:30,125 SEVERE [javax.enterprise.resource.webcontainer.jsf.lifecycle] (http--0.0.0.0-8080-1) JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /blah/blah/blah/blahInfo.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@3dc264b1]
15:38:30,129 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/mgmt].[Faces Servlet]] (http--0.0.0.0-8080-1) Servlet.service() for servlet Faces Servlet threw exception: java.lang.ClassNotFoundException: com.apple.laf.AquaLookAndFeel from [Module "deployment.blah_war-1001.0-SNAPSHOT.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at java.lang.Class.forName0(Native Method) [classes.jar:1.6.0_31]
at java.lang.Class.forName(Class.java:247) [classes.jar:1.6.0_31]
at javax.swing.SwingUtilities.loadSystemClass(SwingUtilities.java:1856) [classes.jar:1.6.0_31]
at javax.swing.UIManager.setLookAndFeel(UIManager.java:563) [classes.jar:1.6.0_31]
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1329) [classes.jar:1.6.0_31]
at javax.swing.UIManager.initialize(UIManager.java:1422) [classes.jar:1.6.0_31]
at javax.swing.UIManager.maybeInitialize(UIManager.java:1410) [classes.jar:1.6.0_31]
at javax.swing.UIManager.getDefaults(UIManager.java:645) [classes.jar:1.6.0_31]
at javax.swing.UIManager.getColor(UIManager.java:687) [classes.jar:1.6.0_31]
at org.jfree.chart.JFreeChart.<clinit>(JFreeChart.java:261) [jfreechart-1.0.13.jar:]
at org.jfree.chart.ChartFactory.createStackedBarChart(ChartFactory.java:950) [jfreechart-1.0.13.jar:]
at this.is.our.code.DisplayChart.buildChart(DisplayChart.java:73) [classes:]
For now we've been able to get around this problem by specifying the default look and feel as a system property when starting JBoss:
-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel
This seems like more of a hack so if there's a better way, we'd like to try that.
I'm not really sure how to test where exactly to add this, but you need to add com.apple.laf,com.apple.laf.resources
as dependencies. In the CLI GUI that ships with AS 7 it's defined in the JAVA_OPTS
with -Djboss.modules.system.pkgs=com.apple.laf,com.apple.laf.resources
. You could add that to your standalone.conf
or domain.conf
depending on which mode you're running in.
You might also just try adding Dependencies: com.apple.laf,com.apple.laf.resources
to your MANIFEST.MF
in your deployment too. I'm not sure if that will work, but it's probably worth a test.
Not sure if related, but for me adding fork="true
to the <java ...>
task in the Ant file helped.
Source: http://lists.apple.com/archives/java-dev/2004/Oct/msg00529.html
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