Pardon me while I dump a stack trace here.  I was getting the following error
while trying to run appfuse:gen on the web portion of my Spring project. 
Using -Dentity.check=false got me past it.  I'm placing the stack trace here
so that others who are searching on one element of the stack trace will get
this thread in their results.

java.lang.StringIndexOutOfBoundsException: String index out of range: 1
        at java.lang.String.charAt(String.java:687)
        at java.util.regex.Matcher.appendReplacement(Matcher.java:703)
        at java.util.regex.Matcher.replaceAll(Matcher.java:813)
        at java.lang.String.replaceAll(String.java:2190)
        at
org.appfuse.mojo.exporter.AppFuseGeneratorMojo.checkEntityExists(AppFuseGeneratorMojo.java:328)
        at
org.appfuse.mojo.exporter.AppFuseGeneratorMojo.addEntityToHibernateCfgXml(AppFuseGeneratorMojo.java:300)
        at
org.appfuse.mojo.exporter.AppFuseGeneratorMojo.execute(AppFuseGeneratorMojo.java:165)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

mraible wrote:
> 
> You can disable the check by passing in -Dentity.check=false. However,
> it's more likely you're looking for the following:
> 
> http://issues.appfuse.org/browse/APF-1012
> 
> Matt
> 
> On Thu, May 8, 2008 at 10:08 PM, Ryan Withers <[EMAIL PROTECTED]>
> wrote:
>> Matt,
>>
>>   I'd like to find out if there is a way I can direct appfuse to look in
>> another directory for entities besides the artifactId.model directory. 
>> What
>> precipitated in this message is a MojoFailureException coming out of the
>> AppFuseGeneratorMojo class.  It looks like the code is looking for a
>> model
>> directory specifically.  This is okay for appfuse generated projects, but
>> what if I want to use the appfuse:gen tool with an existing project
>> without
>> pulling down one of the project Archetypes?
>>
>> The specific code is (from checkEntityExists()):
>>
>> 328                 pathToParent = pathToParent.replaceAll("/",
>> FILE_SEP);
>> 329                 pathToModelPackage = getProject().getBasedir() +
>> FILE_SEP + pathToParent + moduleName + "/" + pathToModelPackage;
>> 330             }
>> 331
>> 332             // refactor to check classpath instead of filesystem
>> 333             String groupIdAsPath =
>> getProject().getGroupId().replace(".", FILE_SEP);
>> 334             File modelPackage = new File(pathToModelPackage +
>> groupIdAsPath + FILE_SEP + "model");
>> 335             boolean entityExists = false;
>> 336
>>
>> So the main question is how can I point appfuse:gen -Dentity=NAME at a
>> custom directory?
>>
>> Thanks for your time,
>>
>> Ryan
>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Generating-from-model-classes-in-a-directory-other-than-artifactId.model--tp17141091s2369p20797456.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to