NutzCN Logo
问答 根据视频搭建一个简单的Nutz.Mvc框架抛异常
发布于 136天前 作者 qq_8ba7eb1c 112 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

根据nutz下载的《第一季-基础框架的搭建.zip》步骤搭建框架,在使用ioc注入后就一直 报这个错,求解!!!

严重: create connection error
org.h2.jdbc.JdbcSQLException: IO Exception: "java.io.FileNotFoundException: C:\Windows\System32\nutz.lock.db (拒绝访问。)"; "C:\Windows\System32\nutz.lock.db" [90031-154]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
	at org.h2.message.DbException.get(DbException.java:156)
	at org.h2.message.DbException.convertIOException(DbException.java:313)
	at org.h2.store.fs.FileSystemDisk.openFileOutputStream(FileSystemDisk.java:359)
	at org.h2.store.FileLock.save(FileLock.java:203)
	at org.h2.store.FileLock.lockFile(FileLock.java:335)
	at org.h2.store.FileLock.lock(FileLock.java:134)
	at org.h2.engine.Database.open(Database.java:535)
	at org.h2.engine.Database.openDatabase(Database.java:218)
	at org.h2.engine.Database.<init>(Database.java:213)
	at org.h2.engine.Engine.openSession(Engine.java:56)
	at org.h2.engine.Engine.openSession(Engine.java:159)
	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:138)
	at org.h2.engine.Engine.createSession(Engine.java:121)
	at org.h2.engine.Engine.createSession(Engine.java:28)
	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:285)
	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:114)
	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:98)
	at org.h2.Driver.connect(Driver.java:72)
	at com.alibaba.druid.pool.DruidAbstractDataSource$DruidPoolConnectionFactory.createConnection(DruidAbstractDataSource.java:1277)
	at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:951)
Caused by: java.io.FileNotFoundException: C:\Windows\System32\nutz.lock.db (拒绝访问。)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at org.h2.store.fs.FileSystemDisk.openFileOutputStream(FileSystemDisk.java:351)
	... 17 more

七月 05, 2017 5:42:31 下午 com.alibaba.druid.logging.JakartaCommonsLoggingImpl error
3 回复

jdbc url换一个

之前我写的jdbc的url是jdbc:h2:nutz,报那个错,最后换成jdbc:h2:~/nutz就可以了,这个有什么区别吗?我看视频里的url就是jdbc:h2:nutz

不带 ~/ 就是当前目录, 带 ~/就是用户主目录, 你的环境很神奇,当前目录在C:\Windows\System32\, 然后非管理员账号无法创建吧

添加回复
请先登陆
回到顶部