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

Can't combine PlayJava with JDebPackaging plugin #407

Closed
danielburrell opened this issue Nov 12, 2014 · 23 comments
Closed

Can't combine PlayJava with JDebPackaging plugin #407

danielburrell opened this issue Nov 12, 2014 · 23 comments

Comments

@danielburrell
Copy link

Whilst trying out 1.0.0-M2 release which fixes the JDebpackaging plugin issues seen on windows relating to chmod, I have since tried to combine the plugin in a real PlayJava project and found issues with chmod again. I have recreated the issue in the minimal project below which only occurs when you add the PlayJava plugin.

Obviously something looks broken here, question is, given it only occurs when the PlayJava plugin is enabled, does this issue sit with play, or sbt-native-packager?

I note that 0.7.4 sbt-native-packager (used by play) is evicted in favour of 1.0.0-M2 so I would expect any behaviour to be coming from sbt-native-packager.

  1. Checkout the project
  2. run activator, and do debian:package-bin
  3. observe it works
  4. Add PlayJava plugin
  5. reload, debian:package-bin
  6. observe the chmod issues.

Console output, and before/after states of build.sbt
https://gist.github.com/danielburrell/be18534a01f55fb9c426
Demo Project: https://github.com/danielburrell/jdebtest.git

@muuki88
Copy link
Contributor

muuki88 commented Nov 12, 2014

Thanks a lot for the detailed bug report. @kardapoltsev already fixed some issues regarding jdeb.
We'll try to fix this until the next milestone release.

@kardapoltsev
Copy link
Member

I'm not very familiar with autoplugins but could you try to enable Play plugin first and then jdeb?

@muuki88
Copy link
Contributor

muuki88 commented Nov 13, 2014

This shouldn't change anything. One of the main reasons for auto plugins was the fixing these ordering issues.

@danielburrell
Copy link
Author

Yep, sorry I forgot to mention, I had tried changing the ordering, this had no effect as mentioned above.

@muuki88
Copy link
Contributor

muuki88 commented Nov 13, 2014

Okay, I can reproduce your error and this is very spurious.
The plugin itself works fine. I think some play internals override
the settings from the JDebPlugin.

@huntc do you now more about this?

I assume this is in Project.scala

 packageArchetype.java_server ++

overrides everything you love.

@huntc
Copy link
Contributor

huntc commented Nov 16, 2014

Sorry - no idea.

Here are the settings I use for a Play project though:

huntc/angular-seed-play-1@typesafehub:master...sbt-native-packager-upgrade

(you can now use the M2 milestone instead of that version I have)

@danielburrell
Copy link
Author

Wouldn't JavaAppPackaging invoke the built-in non-cross-platform .deb packaging tool, rather than JDeb?

@benmccann
Copy link
Contributor

@jsuereth looks like you added a line we have a question about in playframework/playframework@f64336d. Do you know more about it? Sounds like from the commit comment that it was maybe meant to be temporary?

@muuki88 Note that we also do a bunch of native packager setup in PlaySettings.scala

@danielburrell
Copy link
Author

I tried M3, and re-ran the steps in my bug report. It seems to have generated a .deb file, so that's good. I will try this on a real project this evening/soon, (check the file is valid and works on ubuntu), and update this issue.

@muuki88
Copy link
Contributor

muuki88 commented Dec 21, 2014

Nice :) Thanks for reporting back

@danielburrell
Copy link
Author

Ah sorry, I had it pointing to the wrong project version (the one without the PlayJava plugin).
Doesn't work in M3 :(

@benmccann
Copy link
Contributor

I filed a bug to track this in Play since it sounds like that's where the issue is playframework/playframework#3801

@benmccann
Copy link
Contributor

If you try this with Play 2.4 (which you would need to build from source) it should hopefully be fixed now

@danielburrell
Copy link
Author

Ok, thanks for the update, I'll try to give this a go this weekend.

@danielburrell
Copy link
Author

I've tried out the latest, and I still seem to encounter an error, doesn't seem to be related to chmod, however there was an issue with the error below . I've updated the sample project and the error received, let me know if the setup I've used is not longer valid for play 2.4
Same instructions as before.

"[error] java.lang.UnsupportedClassVersionError: play/runsupport/classloader/Appl
icationClassLoaderProvider : Unsupported major.minor version 52.0"

@huntc
Copy link
Contributor

huntc commented Mar 25, 2015

What Java version are you using?

@danielburrell
Copy link
Author

[error] java.lang.UnsupportedClassVersionError: play/runsupport/classloader/Appl
icationClassLoaderProvider : Unsupported major.minor version 52.0
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q

D:\workspace\play-java>java -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

looks like 1.8 unless the project has some setting which determines the version to be used.

@danielburrell
Copy link
Author

Adding detailed stack trace

[info] Loading project definition from D:\workspace\play-java\project
java.lang.UnsupportedClassVersionError: play/runsupport/classloader/ApplicationC
lassLoaderProvider : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
2)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at play.PlayRun$class.$init$(PlayRun.scala:38)
        at play.Play$.<init>(Project.scala:21)
        at play.Play$.<clinit>(Project.scala)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:270)
        at sbt.ModuleUtilities$.getObject(ModuleUtilities.scala:14)
        at sbt.ModuleUtilities$.getCheckedObject(ModuleUtilities.scala:20)
        at sbt.ModuleUtilities$$anonfun$getCheckedObjects$1.apply(ModuleUtilitie
s.scala:23)
        at sbt.ModuleUtilities$$anonfun$getCheckedObjects$1.apply(ModuleUtilitie
s.scala:23)
        at scala.collection.immutable.Stream$$anonfun$map$1.apply(Stream.scala:3
76)
        at scala.collection.immutable.Stream$$anonfun$map$1.apply(Stream.scala:3
76)
        at scala.collection.immutable.Stream$Cons.tail(Stream.scala:1085)
        at scala.collection.immutable.Stream$Cons.tail(Stream.scala:1077)
        at scala.collection.immutable.Stream.foreach(Stream.scala:548)
        at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:
48)
        at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:17
6)
        at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45
)
        at scala.collection.TraversableLike$class.to(TraversableLike.scala:629)
        at scala.collection.AbstractTraversable.to(Traversable.scala:105)
        at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:2
57)
        at scala.collection.AbstractTraversable.toList(Traversable.scala:105)
        at scala.collection.immutable.List.$plus$plus(List.scala:193)
        at sbt.PluginDiscovery$.discoverAll(PluginDiscovery.scala:38)
        at sbt.Load$.loadPlugins(Load.scala:835)
        at sbt.Load$.loadPluginDefinition(Load.scala:792)
        at sbt.Load$.buildPlugins(Load.scala:787)
        at sbt.Load$.plugins(Load.scala:775)
        at sbt.Load$.loadUnit(Load.scala:431)
        at sbt.Load$$anonfun$18$$anonfun$apply$11.apply(Load.scala:281)
        at sbt.Load$$anonfun$18$$anonfun$apply$11.apply(Load.scala:281)
        at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$
apply$5$$anonfun$apply$6.apply(BuildLoader.scala:91)
        at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$
apply$5$$anonfun$apply$6.apply(BuildLoader.scala:90)
        at sbt.BuildLoader.apply(BuildLoader.scala:140)
        at sbt.Load$.loadAll(Load.scala:334)
        at sbt.Load$.loadURI(Load.scala:289)
        at sbt.Load$.load(Load.scala:285)
        at sbt.Load$.load(Load.scala:276)
        at sbt.Load$.apply(Load.scala:130)
        at sbt.Load$.defaultLoad(Load.scala:36)
        at sbt.BuiltinCommands$.doLoadProject(Main.scala:481)
        at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:475)
        at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:475)
        at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.sca
la:58)
        at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.sca
la:58)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.sca
la:60)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.sca
la:60)
        at sbt.Command$.process(Command.scala:92)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
        at sbt.State$$anon$1.process(State.scala:184)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.MainLoop$.next(MainLoop.scala:98)
        at sbt.MainLoop$.run(MainLoop.scala:91)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65)
        at sbt.Using.apply(Using.scala:24)
        at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65)
        at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48)
        at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32)
        at sbt.MainLoop$.runLogged(MainLoop.scala:24)
        at sbt.StandardMain$.runManaged(Main.scala:53)
        at sbt.xMain.run(Main.scala:28)
        at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
        at xsbt.boot.Launch$.run(Launch.scala:109)
        at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
        at xsbt.boot.Launch$.launch(Launch.scala:117)
        at xsbt.boot.Launch$.apply(Launch.scala:18)
        at xsbt.boot.Boot$.runImpl(Boot.scala:41)
        at xsbt.boot.Boot$.main(Boot.scala:17)
        at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.UnsupportedClassVersionError: play/runsupport/classloader/Appl
icationClassLoaderProvider : Unsupported major.minor version 52.0
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

@benmccann
Copy link
Contributor

Hmm, yeah, definitely sounds like you're not using Java 8 though your output of java -version looked like it was. What about javac -version?

@danielburrell
Copy link
Author

You're right. Deleting the 7 installation, revealed JAVA_HOME was pointing to 7. Pointed it to 8 now.

[error] java.lang.NoSuchMethodError: play.PlayImport$PlayKeys$.playWatchService(
)Lsbt/SettingKey;

Tried cleaning out target folder.

@benmccann
Copy link
Contributor

playWatchService was renamed to fileWatchService. See https://www.playframework.com/documentation/2.4.x/Migration24

@danielburrell
Copy link
Author

Ah, sorry, sneaky reference to old version of play hidden in "play-fork-run.sbt".
Confirmed it works. (I haven't verified that the .deb is valid or that it installs correctly. but there is at least a .deb file on disk and no errors in the console).

Thanks so much for all your efforts on this @benmccann @muuki88 @huntc

@muuki88
Copy link
Contributor

muuki88 commented Mar 26, 2015

@danielburrell we have to say thanks as well for giving us valuable feedback and testing bleeding edge tech :)

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

5 participants