{"action":"created","issue":{"url":"https://api.github.com/repos/janino-compiler/janino/issues/13","repository_url":"https://api.github.com/repos/janino-compiler/janino","labels_url":"https://api.github.com/repos/janino-compiler/janino/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/janino-compiler/janino/issues/13/comments","events_url":"https://api.github.com/repos/janino-compiler/janino/issues/13/events","html_url":"https://github.com/janino-compiler/janino/issues/13","id":198723656,"number":13,"title":"Undeclared runtime dependency on de.unkrig.jdiasm.Disassembler","user":{"login":"rktoomey","id":293393,"avatar_url":"https://avatars.githubusercontent.com/u/293393?v=3","gravatar_id":"","url":"https://api.github.com/users/rktoomey","html_url":"https://github.com/rktoomey","followers_url":"https://api.github.com/users/rktoomey/followers","following_url":"https://api.github.com/users/rktoomey/following{/other_user}","gists_url":"https://api.github.com/users/rktoomey/gists{/gist_id}","starred_url":"https://api.github.com/users/rktoomey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rktoomey/subscriptions","organizations_url":"https://api.github.com/users/rktoomey/orgs","repos_url":"https://api.github.com/users/rktoomey/repos","events_url":"https://api.github.com/users/rktoomey/events{/privacy}","received_events_url":"https://api.github.com/users/rktoomey/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-04T14:45:34Z","updated_at":"2017-01-11T13:56:46Z","closed_at":"2017-01-11T13:56:46Z","body":"Digging into this runtime error from a Logback configurator, I discovered that janino has an undeclared runtime dependency on de.unkrig.jdiasm:\r\n\r\n```java\r\njava.lang.ClassNotFoundException: de.unkrig.jdisasm.Disassembler\r\n        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)\r\n        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)\r\n        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)\r\n        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)\r\n        at java.lang.Class.forName0(Native Method)\r\n        at java.lang.Class.forName(Class.java:264)\r\n        at org.codehaus.janino.UnitCompiler.disassembleToStdout(UnitCompiler.java:11913)\r\n        at org.codehaus.janino.UnitCompiler.addClassFile(UnitCompiler.java:847)\r\n        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:841)\r\n        at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:431)\r\n        at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:209)\r\n        at org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:385)\r\n        at org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:380)\r\n        at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1405)\r\n        at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:380)\r\n        at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:354)\r\n        at org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:413)\r\n        at org.codehaus.janino.ClassBodyEvaluator.compileToClass(ClassBodyEvaluator.java:318)\r\n        at org.codehaus.janino.ClassBodyEvaluator.cook(ClassBodyEvaluator.java:235)\r\n        at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:200)\r\n        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:76)\r\n        at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:71)\r\n        at ch.qos.logback.core.joran.conditional.PropertyEvalScriptBuilder.build(PropertyEvalScriptBuilder.java:47)\r\n        at ch.qos.logback.core.joran.conditional.IfAction.begin(IfAction.java:65)\r\n        at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:269)\r\n        at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:145)\r\n        at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:128)\r\n        at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)\r\n        at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:158)\r\n        at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:145)\r\n        at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:103)\r\n        at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)\r\n        at play.api.libs.logback.LogbackLoggerConfigurator.configure(LogbackLoggerConfigurator.scala:94)\r\n```\r\n\r\nWhich is right there in the code but it's not in the pom:\r\n\r\nhttps://github.com/janino-compiler/janino/blob/master/janino/src/main/java/org/codehaus/janino/UnitCompiler.java#L11952-L11967\r\n\r\nPlease add a `runtime` dependency to your pom.xml to make this explicit so that it will show up properly in dependency management tools.  \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/janino-compiler/janino/issues/comments/271874465","html_url":"https://github.com/janino-compiler/janino/issues/13#issuecomment-271874465","issue_url":"https://api.github.com/repos/janino-compiler/janino/issues/13","id":271874465,"user":{"login":"aunkrig","id":5930363,"avatar_url":"https://avatars.githubusercontent.com/u/5930363?v=3","gravatar_id":"","url":"https://api.github.com/users/aunkrig","html_url":"https://github.com/aunkrig","followers_url":"https://api.github.com/users/aunkrig/followers","following_url":"https://api.github.com/users/aunkrig/following{/other_user}","gists_url":"https://api.github.com/users/aunkrig/gists{/gist_id}","starred_url":"https://api.github.com/users/aunkrig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aunkrig/subscriptions","organizations_url":"https://api.github.com/users/aunkrig/orgs","repos_url":"https://api.github.com/users/aunkrig/repos","events_url":"https://api.github.com/users/aunkrig/events{/privacy}","received_events_url":"https://api.github.com/users/aunkrig/received_events","type":"User","site_admin":false},"created_at":"2017-01-11T13:56:46Z","updated_at":"2017-01-11T13:56:46Z","body":"Hello Rose,\r\n\r\nJDISASM is only used when I debug JANINO, that's why it is adressed through REFLECTION and not invoked directly. In other words: JANINO does not (strictly) depend on JDISASM.\r\n\r\nAn attempt to access JDISASM is only made when the Unitcompiler.LOGGER ist set to level FINEST (which is what you obviously did). If, in that case, JDISASM cannot be found on the CLASSPATH, JANINO prints a stack trace to indicate the fact, but continues otherwise.\r\n\r\nTo make the point clearer, I replaced the printing of the stack trace with a log message:\r\n\r\n    UnitCompiler.LOGGER.log(Level.FINEST, (\r\n        \"Notice: Could not disassemble class file for logging because \"\r\n        + \"\\\"de.unkrig.jdisasm.Disassembler\\\" is not on the classpath. \"\r\n        + \"If you are interested in disassemblies of class files generated by JANINO, \"\r\n        + \"get de.unkrig.jdisasm and put it on the classpath.\"\r\n    ));\r\n\r\nPlease let me know if this solution is acceptable for you."}}
{"actor":{"display_login":"aunkrig"}}