commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Härnvi <>
Subject [betwixt] Problem with java.awt.Color
Date Sun, 20 May 2007 15:01:22 GMT

I have an issue (de)serializing instances of java.awt.Color. I have a 
working solution:

I Added a java.awt packages in my own source code and added a .betwixt 
file there:

<?xml version='1.0' encoding='UTF-8' ?>
<info primitiveTypes='attribute'>
<element name="color">
   <attribute name='className' value='java.awt.Color'/>
   <hide property="colorSpace"/>

Then I implemented ChainedBeanCreator and got the RGB values from the 
mapping.getAttributes().getValue("red"), and return a new Color instance.

It works fine, but when used in Tomcat and in an application built on 
Netbeans Platform the betwixt file is not found. I think it's a 
classloading issue. Tomcat and Netbeans won't let me load things from 
the java.awt package inside my jar file. The result is that the RGB 
values end up as elements instead of attributes, and my 
ChainedBeanCreator fails.

So, I need to rework the ChainedBeanCreator to work with elements, and 
I can't figure it out. Here is the resulting XML (without the betwixt 
file in action):

<color id="1285042238">

Anyone have an example on how to work with elements in a 
ChainedBeanCreator? I guess other people need to deal with 
java.awt.Color properties?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message