开发者

Why does enabling the "Any Exception" break point in IDEA cause a ClassNotFoundException when launching Scala swing apps?

开发者 https://www.devze.com 2023-04-12 12:50 出处:网络
It appears that at least an Application-type run target in IDEA with the Scala plugin and the \"Any Exception\" special break-point enabled will cause a ClassNotFoundException with the launcher being

It appears that at least an Application-type run target in IDEA with the Scala plugin and the "Any Exception" special break-point enabled will cause a ClassNotFoundException with the launcher being unable to find the main class or any of the Scala classes, seemingly (I didn't go through every subsequent exception but all the classes I did go through were Scala ones).

Is this just a bug or some Scala behaviour with respect to the Java debugger and the "Any Exception" break-point?

Test code:

package testIDEABug

import swing.{MainFrame, SwingApplication}
import jav开发者_JS百科a.awt.Dimension

object TestApp extends SwingApplication {

    override def startup(args: Array[String]) {

        new MainFrame {
            title = "Testing IDEA Bug"
            size = new Dimension(400, 300)
        }.open()
    }
}

On the up side, it did rightfully punish me for trying to do some parts of the app without tests - sigh


I experienced the ClassNotFoundException problem sporadically (not because I was doing anything with breakpoints, though.) My solutions were 1) to delete the Run/Debug configuration and recreate it using a right-click on the main method I wanted to run (there will be a context-menu item to create a temporary build config for that main.) or 2) switch from external build to internal build. But I think the external build is new in IntelliJ IDEA 12, which I don't think was available when you asked this question...

0

精彩评论

暂无评论...
验证码 换一张
取 消