在idea IDE里开发appfuse 2 project的一些问题

 

通过mvn生成的缺省的appfuse project,在idea里make project时(click工具栏中的“Make Project” ),会抛出下列错误:
src/main/resources/META-INF/persistence.xml
Cannot resolve class 'HibernatePersistence'.
 
原因是classpath里没有hibernate entity manager jar。解决方法是添加缺少的jars,具体步骤是:
1)选定你的project,然后click工具栏的“Settings”Button
2)选择“Project Settings” --> “Modules” --> “Dependencies” -->“Add” Button -->“Project Library…”
3)在弹出的窗口里,先创建一个class library:Click “Create Library…” button,input name “Hibernate Entity Manager”, and then click “Attach Jar Directories”,选定你的hibernate entity manager所在的目录即可
4)重新click “Make project” toolbar button,这时如果看到下列错误的话:
              src/main/webapp/WEB-INF/web.xml
              Cannot resolve sysbol /403.jsp
              Cannot resolve sysbol /error.jsp
              Cannot resolve sysbol /index.jsp
              Cannot resolve sysbol /404.jsp
       表示在web.xml有配置,但在webapp里找不到这几个文件,那你就要执行Step 5
5)通过命令 mvn war:inplace 来把dependent war的内容extract到你的project的src/main/webapp目录下,重新click “Make project” toolbar button,搞定!

你可能感兴趣的:(Hibernate,manager,ide,idea,button,Appfuse)