目前日期文章:201705 (3)

瀏覽方式: 標題列表 簡短摘要

環境:

eclipse : https://eclipse.org/downloads/packages/release/Neon/3

python: Python 3.6.1

django: Django-1.11.1.tar.gz

先下載 Python 3.6.1 安裝在 C:\Python\Python36-32 然後增加 Path

文章標籤

MIS 發表在 痞客邦 PIXNET 留言(0) 人氣()

用 Hibernet Tool 自動產生的 Domain Code,對於 FOREIGN KEY 會以 annotation:  @ManyToMany(fetch = FetchType.LAZY) 來作註,但執行時會發生下列的錯誤

Struts Problem Report

Struts has detected an unhandled exception:

Messages:
  • failed to lazily initialize a collection of role: com.mis.model.Admin.roles, could not initialize proxy - no Session
File: org/hibernate/collection/internal/AbstractPersistentCollection.java
 

Stacktraces

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.mis.model.Admin.roles, could not initialize proxy - no Session

 

文章標籤

MIS 發表在 痞客邦 PIXNET 留言(0) 人氣()

作法如下:

http://stackoverflow.com/questions/26616723/java-lang-nosuchmethoderror-javax-persistence-table-indexesljavax-persistenc

If you are using Jboss 7.1.1, jboss already has hibernate-jpa-2.0 in its classpath, so during runtime it uses the one in its classpath, not the one you've deployed with your app , to point jboss to the hibernate-jpa-2.1 do the following:

  1. copy hibernate-jpa-2.1-api-1.0.0.final.jar to the following directory : jboss-as-7.1.1.Final/modules/javax/persistence/api/main

  2. open module.xml and change the resource-root as follows : resource-root path="hibernate-jpa-2.1-api-1.0.0.final.jar" (pointing it to jpa 2.1)

文章標籤

MIS 發表在 痞客邦 PIXNET 留言(0) 人氣()

找更多相關文章與討論