最近想搭一個 shiro+ssm的快速開發框架,用於后台管理以及微信公眾號的開發。后台主要是權限管理,於是選擇有spring+shiro,微信公眾號的前端頁面搜了下有用velocity開發的,剛好看到群里有人說 springWind,就嘗試了下;
http://git.oschina.net/juapk/SpringWind
從git上面下載后,等待依賴包。。。 相當的慢。 等了一晚上。
之后按照正常的步驟,配置,啟動,然后報錯了:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logAspect' defined in class path resource [spring/spring-framework.xml]: Cannot create inner bean 'com.baomidou.springwind.service.impl.SysLogServiceImpl#7c7defb9' of type [com.baomidou.springwind.service.impl.SysLogServiceImpl] while setting bean property 'logPoint'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.baomidou.springwind.service.impl.SysLogServiceImpl#7c7defb9': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysLogMapper' defined in file [F:\workspace\SpringWind\SpringWind\target\SpringWind\WEB-INF\classes\com\baomidou\springwind\mapper\SysLogMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [F:\workspace\SpringWind\SpringWind\target\SpringWind\WEB-INF\classes\spring\app-datasource.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.ibatis.session.Configuration.getDefaultScriptingLanguageInstance()Lorg/apache/ibatis/scripting/LanguageDriver;
查詢了缺少的類是mybatis的,按說是不應該缺少的啊! 應該是缺少jar包或者jar包起沖突了。這樣想着,於是把默認的mybatis的4.2換成了4.4
還是不行,郁悶了。再自己檢查了下pom.xml文件,發現里面有jdk1.6而本機用的jdk1.8,趕緊換了。再次重啟,總是不報錯了。。。
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'logAspect' defined in class path resource
[spring/spring-framework.xml]: Cannot create inner bean
'com.baomidou.springwind.service.impl.SysLogServiceImpl#7c7defb9' of type
[com.baomidou.springwind.service.impl.SysLogServiceImpl] while setting
bean property 'logPoint'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name
'com.baomidou.springwind.service.impl.SysLogServiceImpl#7c7defb9':
Unsatisfied dependency expressed through field 'baseMapper'; nested
exception is
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name 'sysLogMapper' defined in file [F:\workspace
\SpringWind\SpringWind\target\SpringWind\WEB-INF\classes\com\baomidou
\springwind\mapper\SysLogMapper.class]: Unsatisfied dependency expressed
through bean property 'sqlSessionFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'sqlSessionFactory' defined in file [F:\workspace
\SpringWind\SpringWind\target\SpringWind\WEB-INF\classes\spring\app-
datasource.xml]: Invocation of init method failed; nested exception is
java.lang.NoSuchMethodError:
org.apache.ibatis.session.Configuration.getDefaultScriptingLanguageInstan
ce()Lorg/apache/ibatis/scripting/LanguageDriver;
2)初次搭建的時候,按照作者的提示,需要配置host。如果不想配置host,可以這樣:
修改配置文件 sso.properties
sso.secretkey=Lg8V51188n0809i5l8
sso.cookie.name=uid
sso.cookie.domain=localhost
sso.login.url=http://localhost:8088/SpringWind/account/login.html
如果項目配置了 名稱,后面就跟項目名稱,比如我的是SpringWind,就使用
http://localhost:8088/SpringWind/account/login.html,如果不配置項目名稱,則使用
http://localhost:8088/account/login.html
另外就是修改下domain的值為localhost。作者自己寫的攔截器里面有攔截,如果domain和本地ip地址不同,會一直跳轉到首頁。同理如果部署到服務器,則使用服務器的ip即可。