Thanks for your instructions. .war file is generated and loaded into jetty
when running mvn jetty:run-war.
However if I run mvn jetty:run-war -Dmaven.test.skip=true I got the
following error:
[INFO] Preparing jetty:run-war
[INFO] [aspectj:compile {execution: default}]
[ERROR] The import org.springframework.beans.factory.annotation.Autowired
cannot be resolved
[ERROR] The method findAnnotation(Method, Class ) in the type
AnnotationUtils is not applicable for the argu
ments (Class<User>, Class<Table>)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Compiler errors :
error at import org.springframework.beans.factory.annotation.Autowired;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
G:\source\koolist\src\main\java\com\koolist\app\dao\jpa\UserDaoJpa.java:8:0::0
The import org.springframework.
beans.factory.annotation.Autowired cannot be resolved
error at Table table = AnnotationUtils.findAnnotation(User.class,
Table.class);
^^^^^
G:\source\koolist\src\main\java\com\koolist\app\dao\jpa\UserDaoJpa.java:81:0::0
The method findAnnotation(Meth
od, Class ) in the type AnnotationUtils is not applicable for the arguments
(Class<User>, Class<Table>)
Any comments (I use Struts Basic)? Thanks a lot
Yongping
mraible wrote:
>
> Check for duplicate persistence.xml files in your source tree (i.e.
> src/main/resource and src/test/resources). Also, make sure you run
> clean after running full-source.
>
> Matt
>
> On Nov 26, 2007, at 3:43 PM, Yongping wrote:
>
>>
>> It runs fine when I run mvn jetty:run-war in remote mode (using
>> embedded
>> war?).
>> However I run into a problem when running mvn clean first then mvn
>> jetty:run-war after I downloaded full source code. Source code is
>> completely
>> downloaded with JPA implementation.
>> The error message looks like:
>> [ERROR] FATAL ERROR
>> [INFO]
>> ----------------------------------------------------------------------
>> --
>> [INFO] No name provided and several persistence units found
>> [INFO]
>> ----------------------------------------------------------------------
>> --
>> [INFO] Trace
>> javax.persistence.PersistenceException: No name provided and several
>> persistence units found
>> at
>> org.hibernate.ejb.Ejb3Configuration.configure
>> (Ejb3Configuration.java:226)
>> at
>> org.codehaus.mojo.hibernate3.configuration.JPAComponentConfiguration.c
>> reateConfiguration(JPACompone
>> ntConfiguration.java:26)
>> at
>> org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfigurat
>> ion.getConfiguration(Abstract
>> ComponentConfiguration.java:32)
>> at
>> org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute
>> (Hbm2DDLExporterMojo.java:87)
>> at
>> org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute
>> (HibernateExporterMojo.java:140)
>> at
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo
>> (DefaultPluginManager.java:443)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
>> (DefaultLifecycleExecutor.java:539)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLif
>> ecycle(DefaultLifecycleExecut
>> or.java:480)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecyc
>> le(DefaultLifecycleExecutor.j
>> ava:896)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle
>> (DefaultLifecycleExecutor.java:739
>> )
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
>> (DefaultLifecycleExecutor.java:510)
>>
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneG
>> oal(DefaultLifecycleExecutor.
>> java:493)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
>> (DefaultLifecycleExecutor.java:463)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHand
>> leFailures(DefaultLifecycleEx
>> ecutor.java:311)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegment
>> s(DefaultLifecycleExecutor.ja
>> va:278)
>> at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
>> (DefaultLifecycleExecutor.java:143)
>> at org.apache.maven.DefaultMaven.doExecute
>> (DefaultMaven.java:334)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:
>> 125)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
>> 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:585)
>> 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)
>>
>> I am not quite familiar with Maven. Not sure if something wrong with
>> configuration in POM file.
>> Thanks a lot for help.
>> Yongping
>> --
>> View this message in context: http://www.nabble.com/-2.01-problem-
>> occurred-when-running-mvn-jetty%3Arun-war-against-local-source-
>> resource-tf4878473s2369.html#a13960717
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/-2.01-problem-occurred-when-running-mvn-jetty%3Arun-war-against-local-source-resource-tf4878473s2369.html#a13964356
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]