PIXNET Logo登入

MISTECH 技術手抄本

跳到主文

歡迎光臨 MIS 工作者在痞客邦的小天地

部落格全站分類:圖文創作

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 8月 10 週五 201813:32
  • Create a Multi Language web application with Spring Boot & FreeMarker

(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 7月 14 週六 201815:59
  • Hibernate fetch = FetchType.LAZY 出現 could not initialize proxy - no Session 的解法

使用 Hibernate Tool 產生 Model 時, FetchType 預設是 FetchType.LAZY , 但在執行時, 卻常會產生類似下列 no Session 的錯誤訊息

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.spring.jwt.db.maria.model.authentication.User.userAuthorities, could not initialize proxy - no Session

 

這時候需要在 Method 前加入 @Transactional 就可以解決

@Test @Transactional public void testUserAuthority() { User user = userRepository.findById(1L).get(); JwtUser jwtUser = JwtUserFactory.create(user); logger.info(jwtUser.getUsername()); } 

(繼續閱讀...)
文章標籤

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

  • 個人分類:
▲top
  • 5月 10 週四 201811:29
  • Spring Boot 2 and H2 with gradle

使用 Spring Boot 2 建置系統就是希望快速. 若專案範圍小的話, 資料庫倒是可以考慮使用 H2 database 來建罝

在 build.gradle 上加入

compile('com.h2database:h2') 

然後編輯 application.properties

server.port=8088 # =============================== # H2 # =============================== spring.h2.console.enabled=true spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=sa spring.datasource.password= spring.jpa.database-platform=org.hibernate.dialect.H2Dialect 

(繼續閱讀...)
文章標籤

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

  • 個人分類:Java - Spring
▲top
  • 9月 01 週五 201714:04
  • Yii2 Advanced For Multiple database & Oracle DB 多資料庫設定

 環境: ApacheFriends XAMPP Version 7.1.7





(繼續閱讀...)
文章標籤

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

  • 個人分類:Yii2
▲top
  • 7月 21 週五 201710:03
  • JBoss EAP 6 and Tomcat 8.5 Virtual Directories Configure 虛擬目錄設定方式

在 Tomcat 的 server.xml 裡設定





(繼續閱讀...)
文章標籤

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

  • 個人分類:JBoss
▲top
  • 5月 13 週六 201718:44
  • eclipse pydev django 在 windows 10 的開發環境配置

環境:

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 發表在 痞客邦 留言(0) 人氣(870)

  • 個人分類:Python
▲top
  • 5月 04 週四 201714:59
  • org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role 解決方法

用 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 發表在 痞客邦 留言(0) 人氣(1,621)

  • 個人分類:Struts2 + Spring4 + Hibernate4
▲top
  • 5月 04 週四 201708:54
  • JPA Error Code: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;

作法如下:

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)

  3. re-compile and re-deploy your app, then you are good to go.

module.xml 檔案內容, 置換成 hibernate-jpa-2.1-api-1.0.0.Final.jar :

(繼續閱讀...)
文章標籤

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

  • 個人分類:Struts2 + Spring4 + Hibernate4
▲top
  • 3月 10 週五 201711:08
  • Setup and Configuration of FreeRadius + MySql on Windows 7

所需軟體

1. OS: windows 7

2. xampp-portable-win32-5.5.38-3-VC11.zip

3. FreeRADIUS.net-1.1.7-r0.0.2.exe - 6.74 MB - Licence: GNU/LGPL

4. NTRadPing 測試工具

(繼續閱讀...)
文章標籤

MIS 發表在 痞客邦 留言(1) 人氣(1,660)

  • 個人分類:OS
▲top
  • 2月 16 週四 201717:15
  • JBoss EAP 6.4 設定連結 SQL Server 2016 Express

在目錄 %JBOSS_HOME%\modules\com\microsoft\sqlserver\jdbc\main 下放入 module.xml & sqljdbc42.jar。

module.xml 的內容




(繼續閱讀...)
文章標籤

MIS 發表在 痞客邦 留言(0) 人氣(1,307)

  • 個人分類:Struts2 + Spring4 + Hibernate4
▲top
«1234...15»

Google Search 站內文章搜尋

熱門文章

  • ()Certificate Authority(CA) 憑證簡介
  • ()
  • ()Oracle SQL Loader
  • ()
  • ()IP Address & CIDR 概念
  • ()
  • ()Oracle RMAN 的基本概念與資料庫全備份實作
  • ()
  • ()
  • ()

bloggerads-header

BloggerADs

參觀人氣

  • 本日人氣:
  • 累積人氣:

文章分類

toggle PTC-Windchill (1)
  • System系統類 (1)
toggle Server (6)
  • OS (2)
  • VMware (3)
  • Tomcat (1)
  • JBoss (13)
  • Apache (2)
  • Weblogic (1)
toggle Java (5)
  • Java - Spring (2)
  • JAVA - BASIC (9)
  • JAVA - Struts2 (16)
  • Struts2 + Spring4 + Hibernate4 (10)
  • JAVA - ADF (3)
toggle Oracle EBS (4)
  • EBS - Interface (1)
  • EBS - INV (1)
  • EBS - BASIC (4)
  • EBS - OAF (3)
toggle PL/SQL (1)
  • PL/SQL - BASIC (1)
toggle DataBase (2)
  • DB - MSSQL (10)
  • DB - ORACLE (11)
toggle PHP (2)
  • Yii2 (1)
  • PHP - BASIC (6)
toggle HTML (2)
  • HTML - CSS (1)
  • HTML - SSL (6)
toggle JavaScript (1)
  • JS - BASIC (5)
toggle XOOPS (2)
  • 架站前的準備工作 (8)
  • XOOPS2 的安裝與使用 (1)
toggle Linux (1)
  • Linux - BASIC (7)
  • 未分類文章 (1)

個人資訊

MIS
暱稱:
MIS
分類:
圖文創作
好友:
累積中
地區:

誰來我家