You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Aaron Mulder <am...@alumni.princeton.edu> on 2003/08/30 03:54:28 UTC

Castor At Runtime

	I have the JSR-88 command-line deployer reading and writing XML
files using the Castor-generated code.  Except that when I try to read an
XML file, I get the exception below.  Any ideas?  It's running via twiddle
and ClassWorlds, and it looks like Xerces is in the
target/geronimo-DEV/lib directory, so I'm not sure why it has the problem.  
Perhaps it's getting the JDK 1.4 default parser (Crimson?) instead?

Thanks,
	Aaron

java.lang.RuntimeException: Could not instantiate parser 
org.apache.xerces.parsers.SAXParser: java.lang.ClassCastException
        at 
org.exolab.castor.util.LocalConfiguration.getParser(LocalConfiguration.java:325)
        at 
org.exolab.castor.util.LocalConfiguration.getParser(LocalConfiguration.java:256)
        at 
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:542)
...


Re: Castor At Runtime

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
On Sat, 30 Aug 2003, Jason Dillon wrote:
> Do you get the same problem when using the run:main goal?

	No.  Though I'm not familiar with the Geronimo output, so I'm not 
sure it starts up all the way -- the last message I get is:

[java] 08:17:54,861 DEBUG [InterceptorRegistryRouter]
geronimo.remoting:router=InterceptorRegistryRouter State changed from
starting to running

	Though about 15 lines earlier it did say:

[java] 08:17:54,609 INFO  [Geronimo] Started Server in 1s:59ms

	I guess Castor is used somewhere in the startup sequence?  If you
can point me to it, I'll look at whether I'm invoking it in the same way.  
I'll also try running the deployer through Maven, I guess, just for grins.

Aaron

> On Saturday, August 30, 2003, at 08:54  AM, Aaron Mulder wrote:
> 
> > 	I have the JSR-88 command-line deployer reading and writing XML
> > files using the Castor-generated code.  Except that when I try to read  
> > an
> > XML file, I get the exception below.  Any ideas?  It's running via  
> > twiddle
> > and ClassWorlds, and it looks like Xerces is in the
> > target/geronimo-DEV/lib directory, so I'm not sure why it has the  
> > problem.
> > Perhaps it's getting the JDK 1.4 default parser (Crimson?) instead?
> >
> > Thanks,
> > 	Aaron
> >
> > java.lang.RuntimeException: Could not instantiate parser
> > org.apache.xerces.parsers.SAXParser: java.lang.ClassCastException
> >         at
> > org.exolab.castor.util.LocalConfiguration.getParser(LocalConfiguration. 
> > java:325)
> >         at
> > org.exolab.castor.util.LocalConfiguration.getParser(LocalConfiguration. 
> > java:256)
> >         at
> > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:542)
> > ...
> >
> 


Re: Castor At Runtime

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
	It turns out that if I create target/geronimo-DEV/lib/endorsed and
put xerces in there, and set

-Djava.endorsed.dirs=$TWIDDLE_HOME/lib/endorsed

	in the twiddle script, all is well.  That seems to be the
workaround that Maven uses.

	Is it OK if I go ahead and write up that change as a patch?  It
seems like it's giving preferential treatment to Xerces, but if Sun is
already including a broken version somehow (must be a bad copy of a
dependent class since they don't appear to include Xerces directly?), I
don't see how making our version the system default is any worse.

Aaron

On Sat, 30 Aug 2003, Jason Dillon wrote:
> Ya that would be my guess.  I am waiting for a new release of  
> classworlds (coming out soon) which will make setting up the classpath  
> easier.


Re: Castor At Runtime

Posted by Jason Dillon <ja...@coredevelopers.net>.
Ya that would be my guess.  I am waiting for a new release of  
classworlds (coming out soon) which will make setting up the classpath  
easier.

--jason


On Saturday, August 30, 2003, at 09:09  PM, Aaron Mulder wrote:

> On Sat, 30 Aug 2003, Jason Dillon wrote:
>> Do you get the same problem when using the run:main goal?
>
> 	Interesting.  If I launch the deployer from maven (just change the
> twiddle command in the "run" goal and set fork=false), then Castor  
> works
> (loads an XML file successfully).  If I run it using
> target/geronimo-DEV/bin/deploy, then Castor fails (can write but not  
> read
> XML files).  Must be a difference in how the classpath is set up or
> something?  The "fork=false" may be inheriting the maven XML library
> configuration, but if I set it to true then I can't actually enter any
> commands for the deployer since its hiding in a different VM.
>
> Aaron
>
>> On Saturday, August 30, 2003, at 08:54  AM, Aaron Mulder wrote:
>>
>>> 	I have the JSR-88 command-line deployer reading and writing XML
>>> files using the Castor-generated code.  Except that when I try to  
>>> read
>>> an
>>> XML file, I get the exception below.  Any ideas?  It's running via
>>> twiddle
>>> and ClassWorlds, and it looks like Xerces is in the
>>> target/geronimo-DEV/lib directory, so I'm not sure why it has the
>>> problem.
>>> Perhaps it's getting the JDK 1.4 default parser (Crimson?) instead?
>>>
>>> Thanks,
>>> 	Aaron
>>>
>>> java.lang.RuntimeException: Could not instantiate parser
>>> org.apache.xerces.parsers.SAXParser: java.lang.ClassCastException
>>>         at
>>> org.exolab.castor.util.LocalConfiguration.getParser(LocalConfiguratio 
>>> n.
>>> java:325)
>>>         at
>>> org.exolab.castor.util.LocalConfiguration.getParser(LocalConfiguratio 
>>> n.
>>> java:256)
>>>         at
>>> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:542)
>>> ...
>>>
>>
>


Re: Castor At Runtime

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
On Sat, 30 Aug 2003, Jason Dillon wrote:
> Do you get the same problem when using the run:main goal?

	Interesting.  If I launch the deployer from maven (just change the
twiddle command in the "run" goal and set fork=false), then Castor works
(loads an XML file successfully).  If I run it using
target/geronimo-DEV/bin/deploy, then Castor fails (can write but not read
XML files).  Must be a difference in how the classpath is set up or
something?  The "fork=false" may be inheriting the maven XML library
configuration, but if I set it to true then I can't actually enter any
commands for the deployer since its hiding in a different VM.

Aaron

> On Saturday, August 30, 2003, at 08:54  AM, Aaron Mulder wrote:
> 
> > 	I have the JSR-88 command-line deployer reading and writing XML
> > files using the Castor-generated code.  Except that when I try to read  
> > an
> > XML file, I get the exception below.  Any ideas?  It's running via  
> > twiddle
> > and ClassWorlds, and it looks like Xerces is in the
> > target/geronimo-DEV/lib directory, so I'm not sure why it has the  
> > problem.
> > Perhaps it's getting the JDK 1.4 default parser (Crimson?) instead?
> >
> > Thanks,
> > 	Aaron
> >
> > java.lang.RuntimeException: Could not instantiate parser
> > org.apache.xerces.parsers.SAXParser: java.lang.ClassCastException
> >         at
> > org.exolab.castor.util.LocalConfiguration.getParser(LocalConfiguration. 
> > java:325)
> >         at
> > org.exolab.castor.util.LocalConfiguration.getParser(LocalConfiguration. 
> > java:256)
> >         at
> > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:542)
> > ...
> >
> 


Re: Castor At Runtime

Posted by Jason Dillon <ja...@coredevelopers.net>.
Do you get the same problem when using the run:main goal?

--jason


On Saturday, August 30, 2003, at 08:54  AM, Aaron Mulder wrote:

> 	I have the JSR-88 command-line deployer reading and writing XML
> files using the Castor-generated code.  Except that when I try to read  
> an
> XML file, I get the exception below.  Any ideas?  It's running via  
> twiddle
> and ClassWorlds, and it looks like Xerces is in the
> target/geronimo-DEV/lib directory, so I'm not sure why it has the  
> problem.
> Perhaps it's getting the JDK 1.4 default parser (Crimson?) instead?
>
> Thanks,
> 	Aaron
>
> java.lang.RuntimeException: Could not instantiate parser
> org.apache.xerces.parsers.SAXParser: java.lang.ClassCastException
>         at
> org.exolab.castor.util.LocalConfiguration.getParser(LocalConfiguration. 
> java:325)
>         at
> org.exolab.castor.util.LocalConfiguration.getParser(LocalConfiguration. 
> java:256)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:542)
> ...
>