小编use*_*413的帖子

ProjectMatrixAuthorizationStrategy 的无法解决类异常

我试图通过从旧机器上备份来在新机器上恢复詹金斯。我从旧机器替换了新机器的 jenkins 主目录。当我启动 jenkins 时,它给了我这个错误。

Caused: java.io.IOException: Unable to read /var/lib/jenkins/config.xml
Run Code Online (Sandbox Code Playgroud)

还有

 Caused: hudson.util.HudsonFailedToLoad
Caused: org.jvnet.hudson.reactor.ReactorException
Run Code Online (Sandbox Code Playgroud)

调试信息是---- 调试信息----

message             : hudson.security.ProjectMatrixAuthorizationStrategy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : hudson.security.ProjectMatrixAuthorizationStrategy
class               : hudson.model.Hudson
required-type       : hudson.model.Hudson
converter-type      : hudson.util.RobustReflectionConverter
path                : /hudson/authorizationStrategy
line number         : 11
version             : not available
-------------------------------
Run Code Online (Sandbox Code Playgroud)

这就是我的 config.xml 的样子

<useSecurity>true</useSecurity>
  <authorizationStrategy class="hudson.security.ProjectMatrixAuthorizationStrategy">
    <permission>hudson.model.Hudson.Administer:visha</permission>
  </authorizationStrategy>
Run Code Online (Sandbox Code Playgroud)

有人可以帮忙吗?

jenkins jenkins-plugins jenkins-pipeline

5
推荐指数
1
解决办法
7323
查看次数

如果我在java中创建自己的String类会发生什么?

当我创建自己的String类时.如果在同一个包中有另一个类,main(String [] args)似乎选择我的String类而不是rt.jar中的类.我的问题是,为什么在这种情况下,Bootstrap类加载器不会选择rt.jar中的String类.我的理解是一个类加载请求来到Application loader将被委托给bootstrap类加载器.

java classloader

4
推荐指数
1
解决办法
306
查看次数

将触摸事件从对话框片段传递到正下方的视图(在父活动内)

我

正如您在图像中看到的,红色边框矩形是父活动。蓝色的是对话片段。圆圈表示视图,下面的矩形表示描述。我希望将圆圈上的点击传递给按钮。到目前为止,我已经尝试过 1. 在 Circle View 中重写 onTouchEvent 并返回 false 2. 在 Circle View 上 setOntouchListener 并调用 Activity.dispatchTouchListener 并返回 false 3. 将对话框片段和圆形视图标记为可点击/可聚焦 false。

以上似乎都没有调用下面按钮的 onCLickListener 。我可以看到在 Activity 的 onIterceptTouch() 中接收到触摸事件。请帮忙

活动

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.main_activity)
        val viewTreeObserver = button2.viewTreeObserver
        viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
            override fun onGlobalLayout() {MainFragment.newInstance(button2).show(supportFragmentManager, "dialog")
                button1.viewTreeObserver.removeOnGlobalLayoutListener(this)
            }
        })

        container.setOnClickListener {
            Log.d("Test","Activity clicked")
        }
        button.setOnClickListener {
            Log.d("Test","Button Clicked")
        }
    }

    override fun onTouchEvent(event: MotionEvent?): Boolean {
        Log.d("Test","Activity onTouchEvent")
        return super.onTouchEvent(event)
    } …
Run Code Online (Sandbox Code Playgroud)

android android-fragments android-dialogfragment kotlin dialogfragment

4
推荐指数
1
解决办法
2306
查看次数

React:如何以编程方式设置 React 组件中元素的宽度和高度

我想根据一些计算以编程方式设置容器的宽度和高度。

我正在尝试设置我为 componentDidUpdate() 中的元素创建的 ref 的样式,但它没有效果

export default class CanvasOverlay extends React.Component {
    static propTypes = {
        imageURI : PropTypes.string.isRequired,
    };

    constructor(props) {
        super(props);
        this.width = 0;
        this.height = 0;
        this.canvasOverlay = React.createRef();
    }

    componentDidMount() {
        let image = new Image();
        let that = this;
        image.onload = function() {
            that._updateDimension(image.width, image.height);
        };
        image.src = this.props.imageURI;
    }

    _updateDimension(imageWidth, imageHeight) {
        const canvasOverlay = this.canvasOverlay.current;
        //Ideally there should be some calculations to get width and 
         height
        canvasOverlay.style.width = 480;
        canvasOverlay.style.height = 400; …
Run Code Online (Sandbox Code Playgroud)

css reactjs

1
推荐指数
1
解决办法
1万
查看次数

Spring Boot:错误:提交响应后无法调用sendError()

我收到此错误。 响应提交后无法调用 sendError() 有人能帮我找出原因吗?

    @Entity
    public class Product {

        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private int id;

        @OneToOne(
                fetch = FetchType.LAZY,
                cascade = CascadeType.ALL
        )
        @JoinColumn(name = "details_id")
        private Details details;
//Getters and setters left out for brevity
    }


@Entity
public class Details {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    private String name;
    private String description;
    private float price;
    private float discount;
    @OneToOne(mappedBy = "details")
    private Product product;
}


@RestController
public class ProductController {
    @Autowired
    ProductRepository productRepository;

    @GetMapping("/getAllProducts")
    public Iterable<Product> …
Run Code Online (Sandbox Code Playgroud)

spring jpa spring-data-jpa spring-boot

0
推荐指数
1
解决办法
1317
查看次数