Running Play 2.4.x Locally Yields: java.lang.IllegalArgumentException: port out of range:-1 - scala

While trying to start my Play app locally I am getting a
java.lang.IllegalArgumentException: port out of range:-1
exception followed by a
(*:playRun) java.lang.reflect.InvocationTargetException
message. I can see in the trace the invalid port arg being sent (..../Scala/launcher/sbt-launch.jar" xsbt.boot.Boot "~run -1") but cannot find where to update this argument. There has to be somewhere to override default values. And... No matter what is in the application.conf (http.port) or what I pass on the command line -Dhttp.port I still get the same error. Any info would be enormously appreciated.

I had the same exception and I was in touch with the IntelliJ support team, and got the message it was a bug, because of the https protocol in the open browser field. The url parser cannot handle https and thus not extract the port number.
Bug report here: https://youtrack.jetbrains.com/issue/SCL-9971

Related

How to set SameSite LAX using JBOSS 7.4

We are currently using JBOSS 7.4 for functional testing. I've read on the documentation that undertow version is 2.2.5
and according to the undertow blog
that to configure the samesite cookie on a webapp, I have to added an undertow-handlers.conf file (located in the WEB-INF folder) which contains only the following line:
path(/)->samesite-cookie(mode=Lax)
but this is not working (I'll update with stacktrace later)
I tried different syntaxes but I still cannot start Jboss :
path(/)->samesite-cookie(mode=Lax, cookie-pattern=*) ---> PatternSyntaxException: Dangling meta character '*' near index 0
path(/)->samesite-cookie(mode="Lax", cookie-pattern="*") --->
Caused by: java.lang.IllegalArgumentException: UT000045: Error parsing predicated handler string no handler named samesite-cookie known handlers are [disallowed-methods, allowed-methods, buffer-request, jdbc-access-log, http-continue-accept, secure-cookie, access-log, mark-secure, response-rate-limit, canonical-path, response-code, disable-cache, ssl-headers, trace, blocking, url-decoding, error-file, access-control, redirect, set, ip-access-control, request-limit, resource, compress, restart, clear, byte-range, eager-form-parser, done, rewrite, forwarded, stuck-thread-detector, reverse-proxy, jvm-route, learning-push, dump-request, proxy-peer-address, resolve-local-name, header, store-response, path-separator, resolve-peer-name]:
path(/)->samesite-cookie(mode=\"Lax\", cookie-pattern=\"*\")
^"}}
Any help will be greatly appreciated as none of the above is working.
Thank you.

Moqui - Connecting to an IMAP server over an SSL connection?

I am trying to poll an email server in Moqui 1.5.4. I am using org.moqui.impl.EmailServices.poll#EmailServer from the 'tools' application.
The email server is set up as follows:
<moqui.basic.email.EmailServer emailServerId="testEmail" mailUsername="test.account#xxxxxxx.ie" mailPassword="xxxxxxxx" smtpHost="" smtpPort="" smtpSsl="" storeHost="Webmail8.xxxxxxxxxxx.ie" storePort="993" storeProtocol="imap" storeDelete="N" />
All entries, passwords have been tested on Outlook and connect no problem to the server.
I get a javax.mail.AuthenticationFailedException.
Additional Information:
In initial tests I received the following error message, so I removed the 'static' modifier from the indicated line in the code. (I was not sure yet if it was an issue or if I may be doing something wrong.)
--- 98330 [ndlerThread[15]] WARN moqui.impl.context.TransactionFacadeImpl
Transaction rollback. The rollback was originally caused by: startup failed:
classpath_//org/moqui/impl/pollEmailServer_groovy: 28: Modifier 'static' not allowed here.
# line 28, column 1.
final static Logger logger = LoggerFactory.getLogger("org.moqui.impl.pollEmailServer")
Some things I tried to see if I could resolve the problem include:
setting storeProtocol="imaps"
including the smtp details in the EmailServer entry (note I only need to poll, not send mail).
adding the following line to pollEmailServer.groovy (having looked at the com.sun.mail.imap package).
sessionProperties.put("mail.imap.ssl.enable", true)
Full Authentication failed error message is:
Error running service [org.moqui.impl.EmailServices.poll#EmailServer] (Throwable)
javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(Service.java:306)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at pollEmailServer_groovy.run(pollEmailServer_groovy:47)
at org.moqui.impl.context.runner.GroovyScriptRunner.run(GroovyScriptRunner.groovy:50)
at org.moqui.impl.context.ResourceFacadeImpl.script(ResourceFacadeImpl.groovy:337)
at org.moqui.impl.service.runner.ScriptServiceRunner.runService(ScriptServiceRunner.groovy:49)
at org.moqui.impl.service.ServiceCallSyncImpl.callSingle(ServiceCallSyncImpl.groovy:260)
at org.moqui.impl.service.ServiceCallSyncImpl.call(ServiceCallSyncImpl.groovy:137)
at ServiceRun_xml_transition_run_actions.run(ServiceRun_xml_transition_run_actions:10)
at org.moqui.impl.actions.XmlAction.run(XmlAction.groovy:99)
at org.moqui.impl.screen.ScreenDefinition$TransitionItem.run(ScreenDefinition.groovy:659)
at org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:223)
at org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:217)
at org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:217)
at org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:217)
at org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:217)
at org.moqui.impl.screen.ScreenRenderImpl.internalRender(ScreenRenderImpl.groovy:301)
at org.moqui.impl.screen.ScreenRenderImpl.render(ScreenRenderImpl.groovy:164)
at org.moqui.impl.webapp.MoquiServlet.doScreenRequest(MoquiServlet.groovy:71)
at org.moqui.impl.webapp.MoquiServlet.doPost(MoquiServlet.groovy:37)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at net.winstone.core.ServletCotion.execute(ServletConfiguration.java:270)
at net.winstone.core.SimpleRequestDispatcher.forward(SimpleRequestDispatcher.java:290)
at net.winstone.core.listener.RequestHandlerThread.processRequest(RequestHandlerThread.java:212)
at net.winstone.core.listener.RequestHandlerThread.run(RequestHandlerThread.java:143)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at net.winstone.util.BoundedExecutorService$1.run(BoundedExecutorService.java:81)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Addendum: Processing the messages once polled with Email ECA Rules.
I can see when I turn on logger info in EmailEcaRule.groovy that the condition in my Email ECA keeps evaluating to 'false'. But it shouldn't be?
======== EMECA Process Received Email conditionPassed? false My condition: TestEmail fields:
(Note that I inserted "My condition: ${fields.subject}" into the logger info to double check my condition expression was as it should be.)
My emeca is:
<emecas xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/email-eca-1.5.xsd">
<emeca rule-name="Process Received Email">
<condition><expression>fields.subject == 'TestEmail'</expression></condition>
<actions>
<service-call name="org.moqui.impl.EmailServices.save#EcaEmailMessage" />
</actions>
</emeca>
</emecas>
I have tested and re-tested this. I don't know why it is evaluating to false. Please let me know if any additional information is required.
Still no luck in solving this. I must be doing something stupid. I commented out if (conditionPassed) {} in the EmailEcaRule.groovy to bypass my condition in the Email ECA rule and just run the action, but now it gets hung up with a "Cannot invoke method get() on null object" error in org.moqui.impl.EmailServices.save#EcaEmailMessage, presumably on headers.get('message-id'). But I can see in the log information that the message Id is in the headers information, and successfully converted to lower case.
There were a few issues with this. First is that Moqui was using an old version of JavaMail (now updated to 1.5.4). Another was how the password was passed through, and more generally there was lots of room for improvement in how the script for poll#EmailServer service was using the JavaMail API.
There are various changes in place as of commit #bf0f872. I was able to connect successfully using storeProtocol=imaps, storePort=993, etc.
To answer your question: without these code changes I don't think connection via SSL would be possible. In other words, this ended up being more of a bug report than a question.

Wicket warning allow_url_include=On

From time to time I get the following warning in the logfile of my Wicket application:
04.10.2012 14:52:08,525 WARN [org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper]
Unknown listener interface 'd allow_url_include=On '
What does that mean and how do I fix it? I tried Google, but I could only find results for the PHP configuration allow_url_include.
I'm using Wicket 6.0.0
Most likely an automated tool tries to exploit some PHP application. Wicket can't handle this request and prints the warning. Look in the access log what HTTP requests hit your server at this timestamp to see which request caused this warning.
It's safe to ignore this warning in this case.

Play Framework debugging problems with Eclipse

I am working through the YABE tutorial and would like to throw the debugger on to see why the captcha isnt working correctly.
I am using Eclipse and Play 1.2.
Here is the error im getting when trying to run as:
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Ideas?
Its all there in the message itself!, "Address already in use", ie. the port numbers (8000 or 9000) may be already used/reserved by some other app or you may have a stale Play instance started earlier.
Try changing the JPDA port that Play listens on. It looks like the default port, 8000, is already in use by something else.
You can do this by modifying the "jpda.port" property in "conf/application.conf". Be sure to also modify the Eclipse JPDA launch file (the one that was generated by the play eclipsify command) if that is what you are using to start the debugging session.

V8 version in node and ChromeDevTools?

My main questions are:
What version of V8 am I running from node 0.4.10?
How can I tell if this version is compatible with ChromeDevTools 0.2.2 in Eclipse?
Background: I've almost got Eclipse working for debugging node.js remotely. In fact it works perfectly (after adding a server proxy) for a simple "Hello World" app, but it won't hook up properly when I add "express" to the mix. The Eclipse error is:
An internal error occurred during: "Debug session initialization:
Remote NodeJS". Exception occured in callback
...which I tracked down to line 61 of the this source code (Thanks to the misspelling of "occured".)
I'd like to eliminate version skew possibilities before going further.
EDIT: Dug the stack trace out of the error log. Hmmm, maybe I have an encoding problem in my server proxy?
java.lang.RuntimeException: Exception occured in callback
at org.chromium.sdk.CallbackSemaphore.tryAcquire(CallbackSemaphore.java:61)
at org.chromium.sdk.CallbackSemaphore.tryAcquireDefault(CallbackSemaphore.java:29)
at org.chromium.sdk.internal.JavascriptVmImpl.getScripts(JavascriptVmImpl.java:33)
at org.chromium.debug.core.model.VProjectWorkspaceBridge.reloadScriptsAtStart(VProjectWorkspaceBridge.java:121)
at org.chromium.debug.core.model.LaunchInitializationProcedure.execute(LaunchInitializationProcedure.java:80)
at org.chromium.debug.core.model.LaunchInitializationProcedure.access$0(LaunchInitializationProcedure.java:64)
at org.chromium.debug.core.model.LaunchInitializationProcedure$1.run(LaunchInitializationProcedure.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.Exception: Exception saved from callback
at org.chromium.sdk.CallbackSemaphore.callbackDone(CallbackSemaphore.java:72)
at org.chromium.sdk.internal.DebugSession$ScriptLoader$2.callbackDone(DebugSession.java:276)
at org.chromium.sdk.internal.tools.v8.BaseCommandProcessor.callThemBack(BaseCommandProcessor.java:136)
at org.chromium.sdk.internal.tools.v8.BaseCommandProcessor.processIncoming(BaseCommandProcessor.java:103)
at org.chromium.sdk.internal.tools.v8.V8CommandProcessor.processIncomingJson(V8CommandProcessor.java:109)
at org.chromium.sdk.internal.StandaloneVmImpl$4.messageReceived(StandaloneVmImpl.java:108)
at org.chromium.sdk.internal.transport.SocketConnection$RegularMessageItem.report(SocketConnection.java:120)
at org.chromium.sdk.internal.transport.SocketConnection$ResponseDispatcherThread.run(SocketConnection.java:206)
Caused by: java.lang.RuntimeException: org.eclipse.core.internal.resources.ResourceException: < is an invalid character in resource name '<eval #83>.chromium'.
at org.chromium.debug.core.util.ChromiumDebugPluginUtil$4.tryCreate(ChromiumDebugPluginUtil.java:247)
at org.chromium.debug.core.util.ChromiumDebugPluginUtil$4.tryCreate(ChromiumDebugPluginUtil.java:1)
at org.chromium.debug.core.util.UniqueKeyGenerator.createUniqueKey(UniqueKeyGenerator.java:22)
at org.chromium.debug.core.util.ChromiumDebugPluginUtil.createFile(ChromiumDebugPluginUtil.java:254)
at org.chromium.debug.core.model.ResourceManager.createAndRegisterResourceFile(ResourceManager.java:106)
at org.chromium.debug.core.model.ResourceManager.addScript(ResourceManager.java:72)
at org.chromium.debug.core.model.VProjectWorkspaceBridge$2.success(VProjectWorkspaceBridge.java:131)
at org.chromium.sdk.internal.DebugSession$ScriptLoader$1$1.call(DebugSession.java:236)
at org.chromium.sdk.internal.DebugSession$ScriptLoader$1.processCall(DebugSession.java:258)
at org.chromium.sdk.internal.DebugSession$ScriptLoader$1.success(DebugSession.java:233)
at org.chromium.sdk.internal.tools.v8.V8Helper$2.success(V8Helper.java:120)
at org.chromium.sdk.internal.tools.v8.V8CommandCallbackBase.messageReceived(V8CommandCallbackBase.java:25)
at org.chromium.sdk.internal.tools.v8.V8CommandCallbackBase.messageReceived(V8CommandCallbackBase.java:1)
at org.chromium.sdk.internal.tools.v8.BaseCommandProcessor$2.call(BaseCommandProcessor.java:99)
at org.chromium.sdk.internal.tools.v8.BaseCommandProcessor$2.call(BaseCommandProcessor.java:1)
at org.chromium.sdk.internal.tools.v8.BaseCommandProcessor.callThemBack(BaseCommandProcessor.java:129)
... 5 more
Caused by: org.eclipse.core.internal.resources.ResourceException: < is an invalid character in resource name '<eval #83>.chromium'.
at org.eclipse.core.internal.resources.Resource.checkValidPath(Resource.java:432)
at org.eclipse.core.internal.resources.File.create(File.java:116)
at org.eclipse.core.internal.resources.File.create(File.java:196)
at org.chromium.debug.core.util.ChromiumDebugPluginUtil$4.tryCreate(ChromiumDebugPluginUtil.java:245)
... 20 more
process.versions in the repl reveals this information:
> process.versions
{ node: '0.4.10', v8: '3.1.8.26', ares: '1.7.4', ev: '4.4', openssl: '1.0.0d' }
There shouldn't be any version-related problem here, at least at initialization stage.
V8 debug protocol is evolving quite slowly.
Unfortunately the message you cite is too general. Do you think you can find a stacktrace somewhere? The message may have 'details' button (but you would probably spot it), also the exception is usually logged. You can try to open a view "General->Error Log" (available in most Eclipse configurations), or you can take a look inside a file in your Eclipse workspace: /.metadata/.log.
The code indicates that there is a cause exception, which is missing from the error message.
Thank you for the spelling error report. :)