configuration using 'implementation' attribute: 'org.eclipse.jetty.server.nio.SelectChannelConnector

      今天在用maven搭spring MVC项目时,总是报configuration using 'implementation' attribute: 'org.eclipse.jetty.server.nio.SelectChannelConnector这个错,换了jdk版本为高版本也不行,后来换了maven-jetty-plugin为高版本,这下就好了,可能还是与jdk有关,还有一点就是<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">它是适用jetty 7以上的,如果是7以下的话,就用<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
`java.nio.file.attribute.UserPrincipalNotFoundException` 是一个检查异常,表示试图访问文件系统中不存在的用户或组。 当使用 `Files.setAttribute()` 方法更新文件系统属性时,如果指定的用户或组不存在,则该异常将被抛出。 以下是一个示例代码,演示了如何使用 `Files.setAttribute()` 方法并捕获 `UserPrincipalNotFoundException` 异常: ```java import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.UserPrincipalNotFoundException; import java.nio.file.attribute.UserPrincipal; import java.io.IOException; public class Main { public static void main(String[] args) { Path path = Paths.get("file.txt"); try { UserPrincipal owner = path.getFileSystem().getUserPrincipalLookupService().lookupPrincipalByName("johndoe"); Files.setAttribute(path, "owner:owner", owner); } catch (UserPrincipalNotFoundException e) { System.err.println("User does not exist: " + e.getMessage()); } catch (IOException e) { System.err.println("Error updating file attributes: " + e.getMessage()); } } } ``` 在上面的代码中,我们尝试将文件 `file.txt` 的所有权更改为 `johndoe` 用户。如果用户不存在,将捕获 `UserPrincipalNotFoundException` 异常并输出错误消息。如果在更新文件属性时出现任何其他错误,则将捕获 `IOException` 异常并输出错误消息。 注意,在使用 `Files.setAttribute()` 方法之前,必须使用 `UserPrincipalLookupService.lookupPrincipalByName()` 方法查找用户或组的 `UserPrincipal` 对象。如果找不到该用户或组,则将抛出 `UserPrincipalNotFoundException` 异常。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值