Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler crash on flickrj #8586

Closed
scabug opened this issue May 14, 2014 · 2 comments
Closed

Compiler crash on flickrj #8586

scabug opened this issue May 14, 2014 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented May 14, 2014

How to reproduce:

% wget http://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar
% CLASSPATH=flickrj-android-2.0.8.jar scala-2.10
[...]
scala> new com.googlecode.flickrjandroid.Flickr("a","b")
warning: Class org.json.JSONException not found - continuing with a stub.
[...]
That entry seems to have slain the compiler.  Shall I replay
your session? I can re-run each line except the last one.

Some analysis

As far as I can tell, the root cause of the issue is the ClassNotFound on JsonException. Adding json to the classpath make it complain about LoggerFactory, but does not crash the compiler. Adding slf4j make the code work.

% wget http://repo1.maven.org/maven2/org/json/json/20140107/json-20140107.jar
% wget http://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar
% CLASSPATH=flickrj-android-2.0.8.jar:json-20140107.jar:slf4j-api-1.7.7.jar scala-2.10
[...]
scala> new com.googlecode.flickrjandroid.Flickr("a","b")
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
res0: com.googlecode.flickrjandroid.Flickr = com.googlecode.flickrjandroid.Flickr@7fe69211

Some (useful ?) context

We found the bug while starting a play project. Adding the flickr4j-android dependency totally break the project with weird errors. For some reason, the json dependency is not declared in the flickr4j pom.

@scabug
Copy link
Author

scabug commented May 14, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8586?orig=1
Reporter: Mathieu Poumeyrol (kali)
Affected Versions: 2.10.4, 2.11.0
Other Milestones: 2.11.1
See #8442

@scabug
Copy link
Author

scabug commented May 14, 2014

@retronym said (edited on May 14, 2014 12:27:43 PM UTC):
This crash progressed to a regular error message in the forthcoming 2.10.5 / 2.11.1.

See: #8442

% tail test.scala build.sbt
==> test.scala <==
object Test {
  new com.googlecode.flickrjandroid.Flickr("a","b")
}
==> build.sbt <==
scalaVersion := "2.10.4"

libraryDependencies += "com.googlecode.flickrj-android" % "flickrj-android" % "2.0.8"

% sbt compile
...
[info] 'compiler-interface' not yet compiled for Scala 2.10.5-20140407-165700-ec05aeb3d6. Compiling...
[info]   Compilation completed in 10.284 s
[warn] Class org.json.JSONException not found - continuing with a stub.
[error] Class org.json.JSONException not found - continuing with a stub.
[warn] one warning found
[error] one error found
[error] (compile:compile) Compilation failed
[error] Total time: 64 s, completed May 14, 2014 2:24:44 PM

@scabug scabug closed this as completed May 14, 2014
@scabug scabug added this to the 2.10.5 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants