|AffirmativeBased.java:66|decide||45||||Voter: org.springframework.security.web.access.expression.WebExpressionVoter@66ebcd8e, returned: -1 APPLICATION|DEBUG|||2023-06-12 14:55:20:198|||AuditListener.java:47|onAuditEvent||45||||AuditEvent [timestamp=2023-06-12T06:55:20.198Z, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}] APPLICATION|DEBUG|||2023-06-12 14:55:20:199|||ExceptionTranslationFilter.java:181|handleSpringSecurityException||45||||Access is denied (user is anonymous); redirecting to authentication entry point org.springframework.security.access.AccessDeniedException: Access is denied
时间: 2023-07-19 09:47:30 浏览: 186
这是一段 Java 代码的日志信息,看起来是使用 Spring Security 框架实现的权限控制功能出现了异常。具体来说,是在 AffirmativeBased 类的第 66 行执行了 decide 方法,返回值为 -1,表示权限检查失败,导致一个名为 AuditEvent 的异常事件被记录下来。异常信息显示访问被拒绝,因为用户未经身份验证或者身份验证失败,需要重定向到身份验证入口点进行身份验证。
相关问题
Use c # to complete the following code,Creating a Car class A class is a self-contained piece of software that is able to function on it own. We will model a car in software. Car Class Properties Year : int «private set» Manufacturer : string «private set» Model : string «private set» IsDrivable : bool «private set» Price : double «private set» Methods«constructor» Car(year : int, manufacturer : string, model : string, price : double, isDrivable: bool = true) PrintInfo() : void Description of field members: 1. year: this private member represents the year value of this object 2. manufacturer: this private member represents the manufacturer of this car 3. model: this private member represents the model of this car 4. isDrivable: this private member indicates if this car be driven 5. price: this private member represents the selling price of this car Constructor: 1. public Car(int year, string manufacturer, string model, double price, bool isDrivable = true): this is the constructor of this class. It takes five arguments and assigns them to the appropriate fields. You will assume that all the arguments will be sane (i.e. the values will not break your program). Apology: UML and some newer languages specify the type after the identifier. C# on the other hand requires that you specify the type and then the identifier. To restrict access fields are normally decorated with the private modifier. Programming II Car: fields, constructor, ToString() n.k.p Page 2 of 2 Description of action member: 1. public void PrintInfo(): this method does not take any argument but it will print all information about this object. You get to decide how the output will look like. It is expected that all the values be displayed. In your main method write the code to do the following: 1. Create at least four cars and print them. Remember to call the constructor with 4 or 5 parameters.
Here's the code to create a Car class in C#:
```
using System;
class Car
{
private int year;
private string manufacturer;
private string model;
private bool isDrivable;
private double price;
public Car(int year, string manufacturer, string model, double price, bool isDrivable = true)
{
this.year = year;
this.manufacturer = manufacturer;
this.model = model;
this.price = price;
this.isDrivable = isDrivable;
}
public void PrintInfo()
{
Console.WriteLine("Year: " + year);
Console.WriteLine("Manufacturer: " + manufacturer);
Console.WriteLine("Model: " + model);
Console.WriteLine("Is Drivable: " + isDrivable);
Console.WriteLine("Price: " + price);
}
}
```
In your main method, you can create four Car objects and print their information like this:
```
static void Main(string[] args)
{
Car car1 = new Car(2021, "Toyota", "Camry", 25000.0);
Car car2 = new Car(2019, "Honda", "Civic", 20000.0, false);
Car car3 = new Car(2018, "Ford", "Mustang", 35000.0);
Car car4 = new Car(2020, "Tesla", "Model S", 80000.0);
car1.PrintInfo();
car2.PrintInfo();
car3.PrintInfo();
car4.PrintInfo();
}
```
This will output the information for all four cars.
Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (org.jenkinsci.plugins.docker.workflow.Docker build java.util.LinkedHashMap org.codehaus.groovy.runtime.GStringImpl java.lang.String). Administrators can decide whether to approve or reject this signature.
这个错误是由于 Jenkins 的脚本安全配置导致的。默认情况下,Jenkins 限制了一些敏感方法的使用,以保护系统安全。在你的情况下,Jenkins 阻止了使用 `docker.build` 方法。
要解决这个问题,你可以执行以下操作之一:
1. 请求管理员批准:联系 Jenkins 管理员,并请求他们在 Jenkins 主页的 "Manage Jenkins" -> "In-process Script Approval" 中批准 `docker.build` 方法的使用。
2. 使用脚本安全插件:安装并配置 Jenkins 的 Script Security 插件。该插件允许你管理 Jenkins 脚本的安全策略。
- 在 Jenkins 主页,点击左侧导航栏的 "Manage Jenkins"。
- 在 "Manage Jenkins" 页面,点击 "Manage Plugins"。
- 切换到 "Available" 选项卡,并在搜索框中输入 "Script Security"。
- 找到 "Script Security" 插件,并勾选它。
- 点击页面底部的 "Install without restart" 按钮,等待插件安装完成。
- 安装完成后,点击左侧导航栏的 "Manage Jenkins",然后选择 "In-process Script Approval"。
- 在 "In-process Script Approval" 页面,你可以对被阻止的方法进行批准或拒绝。
请注意,脚本安全是为了保护系统安全,并防止恶意代码的执行。在使用脚本安全插件时,仔细审查脚本中使用的方法和操作,并确保只批准你信任的、合法的操作。
阅读全文