Error: Creating simple Play project in IntelliJ - playframework-2.3

I am new to play framework and SBT build tools.. I wanted to test simple Hello world using IntelliJ idea ...But having following issue...Could you please tell me what is going wrong...
Error:Error while importing SBT project:
...
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
[error] (*:update) sbt.ResolveException: unresolved dependency: sbt-run-support-210#sbt-run-support-210_2.10;0.1-SNAPSHOT: not found
Invalid response.
Invalid response.

You can do this in two steps:
Use activator to prepare Idea project: $ activator idea
Import project in Idea as existed project
Documentation for version 2.3 is a little bit confusing.
See for 2.1, it's relevant (except activator command) https://www.playframework.com/documentation/2.1.x/IDE#IntelliJ

Don't create Play application in the Idea, instead use the console tool like: activator new and after choosing the options in the tool and creating the project just import it in Idea as Import project from external model > SBT

Related

How to configure Hudson base distribution?

I am a total newbie to the Hudson administration, so my question is very 101:
I downloaded hudson-3.0.0.war, which is said to be just the Hudson Core without any plugins included, and deployed it on my Apache Tomcat 7.0 server.
So Hudson as a web app is up, I can browse it, manage plugins via UI and so on.
But when I try to create my very first job as Build a free-style software project, I get the following exception:
HTTP Status 500 - java.lang.NoClassDefFoundError: org/eclipse/hudson/utils/tasks/MetaProject
type Exception report
message java.lang.NoClassDefFoundError: org/eclipse/hudson/utils/tasks/MetaProject
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/eclipse/hudson/utils/tasks/MetaProject
I assume that a certain plugin is missing (although I would expect that even the base distribution included such a basic task, but never mind...).
I cannot figure out which plugin I have to install in order to enable the job creation between all available plugins.
I am really hoping to any assistance with this issue, which I shall appreciate very much.
It looks like you are missing a dependency. Add to the pom.xml the dependency:
<dependency>
    <groupId>org.eclipse.hudson</groupId>
    <artifactId>hudson-plugin-utils</artifactId>
    <version>3.0.1</version>
</dependency>

Idea 12/Haxe2.10(win): why do I get AssertionError: Wrong node when I try to build a project?

My OS is Win7 64 Enterprise.
I've just installed idea12 (ultimate), added Haxe plugin (0.5.6), installed haxe sdk 2.10win, also tried using 2.09win that comes with fdt.
When I try to build a project with Idea, I get following exception:
Internal error: (java.util.concurrent.ExecutionException) java.lang.AssertionError: Wrong node: [null]
java.util.concurrent.ExecutionException: java.lang.AssertionError: Wrong node: [null]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.a(JpsProjectLoader.java:231)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.a(JpsProjectLoader.java:105)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadProject(JpsProjectLoader.java:81)
at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:41)
at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:60)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:169)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:94)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:105)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:26)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.AssertionError: Wrong node: [null]
at com.intellij.util.xmlb.BeanBinding._deserializeInto(BeanBinding.java:133)
at com.intellij.util.xmlb.BeanBinding.deserialize(BeanBinding.java:120)
at com.intellij.util.xmlb.XmlSerializer.deserialize(XmlSerializer.java:58)
at org.jetbrains.jps.haxe.model.module.JpsHaxeModuleType$1.loadProperties(JpsHaxeModuleType.java:26)
at org.jetbrains.jps.haxe.model.module.JpsHaxeModuleType$1.loadProperties(JpsHaxeModuleType.java:23)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.a(JpsProjectLoader.java:294)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.a(JpsProjectLoader.java:255)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.access$000(JpsProjectLoader.java:44)
at org.jetbrains.jps.model.serialization.JpsProjectLoader$2.call(JpsProjectLoader.java:225)
at org.jetbrains.jps.model.serialization.JpsProjectLoader$2.call(JpsProjectLoader.java:222)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:35)
... 7 more
This issue can't be in Haxe sdk as it compiles project fine under fdt (however, sdk-based autocomplete is not working, but I think it is not related to idea problem). Other project types (like java) are working fine with idea.
So, what shall I try to solve this issue? What does that exception mean?
Update: Installed idea 12.01 on WIN7 32 Professional, created new project - same exception happens. So, I conclude that this issue is not related to 32/64 bit OS or Java. This issue is not specific to idea version 12.00.
May be it is important that new project created by idea contains neither .hx classes, nor any build configuration files(like .hxml). I tried to create .hx main class and .hxml build for it, but idea still does not build project.
Changing run configuration to one of those files or to .swf result(built manually) or to cmd does not help(run option still not available).
I also tried to build with ant task, and it succeeded, but idea still can't build a project when I choose this option from menu.
The problem will be fixed in IDEA 12.0.2, thank you for reporting. As a workaround you can switch off 'Use external build' option in File | Settings | Compiler.
I cannot reproduce your error. Please try the usual reinstall, remove/add the Haxe SDK again, Invalidate Cache and restart (from the file menu).
If you can reproduce this problem with a fresh install, the best place for Idea support is their forum or create a new issue on their tracker http://youtrack.jetbrains.com/issues/IDEA?p=0&q=haxe
They have been very helpful to me in the past.

Why is Restlet unable to Register the JSON Converter?

I'm at my wit's end here - never seemed to have faced this problem. I find it relatively easy to set up quick HelloWorld applications to ensure Restlet 2.0 is up and running. However, I'm facing a strange exception which I've never encountered before. I have the jars in my classpath as well as the WEB-INF/lib folder but for some reason I keep getting the following exception:
INFO: Unable to register the helper org.restlet.ext.json.JsonConverter
java.lang.NoClassDefFoundError: org/json/JSONException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at org.restlet.engine.Engine.registerHelper(Engine.java:718)
at org.restlet.engine.Engine.registerHelpers(Engine.java:753)
at org.restlet.engine.Engine.registerHelpers(Engine.java:793)
at org.restlet.engine.Engine.discoverConverters(Engine.java:501)
at org.restlet.engine.Engine.<init>(Engine.java:337)
at org.restlet.engine.Engine.register(Engine.java:248)
at org.restlet.engine.Engine.register(Engine.java:237)
at org.restlet.engine.Engine.getInstance(Engine.java:149)
at org.restlet.engine.Engine.getLogger(Engine.java:204)
at org.restlet.Context.<init>(Context.java:160)
at org.restlet.Context.<init>(Context.java:133)
at org.restlet.ext.servlet.ServerServlet.createComponent(ServerServlet.java:422)
at org.restlet.ext.servlet.ServerServlet.getComponent(ServerServlet.java:763)
at org.restlet.ext.servlet.ServerServlet.init(ServerServlet.java:881)
at javax.servlet.GenericServlet.init(GenericServlet.java:242)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1428)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1060)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.json.JSONException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:959)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1430)
... 45 more
The following jars are in my classpath and the WEB-INF/lib folders:
org.json.jar
org.restlet.jar
org.restlet.ext.servlet
org.restlet.ext.json
I'm building the project using Eclipse and deploying on Glassfish. The web.xml etc are all fine and no deployment errors...however, this one has had me scratching my head for a while.
Any ideas?
I had the same or a similar problem. I want to override the jackson representation and remove some dependencies it imports but when I do, the jackson converter is not discovered.
Then I've found why in my case: the jar contains a META-INF/services folder with a file called org.restlet.engine.converter.ConverterHelper. That's how discovery works.
I've tried to add that files to my path and it didn't work, don't know. So I ended up registering the Jackson converter
Engine.getInstance().getRegisteredConverters().add(new JacksonConverter());
For some reason the error went away when I swapped the file with that from the Restlet Distribution - in the org.json folder of the Restlet Java EE version.
Seems maybe something was missing in the org.json.jar that I had from the json website, don't know...
It looks like your application isn't able to find a library. If you're building your app in Eclipse, have you made sure that the libraries are being exported? Go to the Build Path section, and make sure the checkbox for exporting libraries is checked.

Jruby log4j integration

I am currently working on integrating Java application General Architecture For Text Engineering (GATE) with a Rails application using JRuby architecture. When we worked on integrating JRuby with log4j, I am getting following error:
0 [main] DEBUG Main.class - Hello world
gate/Gate.java:80:in `<clinit>': java.lang.NoClassDefFoundError: org/apache/log4
j/Logger (NativeException)
from gateapp/Main.java:86:in `main'
from test.rb:12
test.rb is the name of ruby program.
I tried importing all the log4j apache libraries, and included the class file in the test.rb file.
When I run the Java program alone its running fine. But when I generate the jar file and include them in Ruby file (test.rb) , I am getting this error
java.lang.NoClassDefFoundError: org/apache/log4j/Logger (NativeException) problem is occuring. How to deal with this problem ?
You need to make sure the log4j JAR file is in your classpath. One way to do this is to set the CLASSPATH variable in your environment. Another way would be to call require in your ruby code like
require "/some/path/MyStuff.jar"
Here is my config to set it up with couchbase Java SDK
include Java
def setup_log4j
java::lang.System.setProperty("net.spy.log.LoggerImpl", "net.spy.memcached.compat.log.Log4JLogger")
fa = Java::OrgApacheLog4j::FileAppender.new();
fa.setName("FileLogger");
fa.setFile("./log/#{Rails.env}.log");
fa.setLayout(Java::OrgApacheLog4j::PatternLayout.new("%d %-5p [%c{1}] %m%n"));
fa.setThreshold(Java::OrgApacheLog4j::Level::INFO);
fa.setAppend(true);
fa.activateOptions();
Java::OrgApacheLog4j::Logger.getRootLogger().addAppender(fa)
end
Just beware that I required the lo4j.jar file earlier.
Worth to mention that there is project named log4jruby.

Groovy: deploying a war file

I have a groovy application running locally on my desktop.
Apparently it runs error free. At least all unit tests I wrote are fulfilled.
I want to deploy the application using a war file. For this I use the command
grails war
in the home directory of the application. When doing this I am getting the following exception:
Error executing script War: java.lang.NullPointerException
gant.TargetExecutionException: java.lang.NullPointerException
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:331)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
Caused by: java.lang.NullPointerException
at _GrailsWar_groovy$_run_closure5_closure25_closure26_closure28.doCall(_GrailsWar_groovy:289)
at _GrailsWar_groovy$_run_closure5_closure25_closure26_closure28.doCall(_GrailsWar_groovy)
at _GrailsWar_groovy$_run_closure5_closure25_closure26.doCall(_GrailsWar_groovy:282)
at _GrailsWar_groovy$_run_closure5_closure25_closure26.doCall(_GrailsWar_groovy)
at _GrailsWar_groovy$_run_closure5_closure25.doCall(_GrailsWar_groovy:258)
at _GrailsWar_groovy$_run_closure5.doCall(_GrailsWar_groovy:256)
at _GrailsWar_groovy$_run_closure4.doCall(_GrailsWar_groovy:239)
at War$_run_closure1.doCall(War.groovy:38)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
... 10 more
Any hint why?
Thanks a lot in advance
I think you'll have to find the source of Gant.groovy and see what it's doing on that line. Apparently there is some problem caused by your project's specific configuration (since such a show-stopper bug would have been caught if it always occurred), but the error message does not contain much information.
Alternatively, you could try upgrading Grails to the latest version 1.1.1 if you haven't already.