You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ji...@codehaus.org on 2004/04/24 01:39:04 UTC

[jira] Created: (MPCASTOR-3) "castor:generate" not working when using J2SDK >= 1.4

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/secure/ViewIssue.jspa?key=MPCASTOR-3

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPCASTOR-3
    Summary: "castor:generate" not working when using J2SDK >= 1.4
       Type: Bug

     Status: Unassigned
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-castor-plugin

   Assignee: 
   Reporter: David Thexton

    Created: Fri, 23 Apr 2004 7:38 PM
    Updated: Fri, 23 Apr 2004 7:38 PM
Environment: Windows or Linux, J2SDK 1.5.0-beta1, 1.4.1 or 1.4.2 or 1.4.2_03, Maven 1.0-rc2

Description:
I have some schema files I generate Java classes from using Castor.  A snippet from my maven.xml looks like:

<attainGoal name="castor:prepare-filesystem"/>
<castor:generate
    schema="${maven.src.dir}/xsd/adapter.script.xsd"
    package="com.piplusplus.messaging.configuration"/>

When I use JDK 1.3.1 it generates the source correctly.  When using any of the newer Java versions I instead get the following obscure error:

java.lang.NoClassDefFoundError: sun/reflect/ConstructorAccessorImpl

I tried adding the "-X" and "-verbose:class" options to track the problem further and also tried debugging against with the Castor source in my path.  I think I began to make some progress, but subsequently gave up.  From memory it was having problems unmarshalling the "simple types" (or similar) properties file.

After much lost time I found that the problem was avoided by causing the  invokation of the source generator to be done in a forked process.

This can be achieved by pretending to have a Castor properties file by adding the line "maven.castor.properties.dir=." to the "project.properties" file, which is the workaround I'm currently using.

I've also added a patch to always fork, rather than only when a Castor properties file is available.

If "someone" could take a look at what I've done and commit if appropriate I'd be appreciative.  If not, then at least if I save someone's time I'd be happy too.  I like Maven, but it can be difficult to debug certain problems that occur.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org