StackTrace
onFailure: rocket.remoting.client.CometException: com.google.gwt.core.client.JavaScriptException: (SyntaxError): Unterminated string constant
number: -2146827273
description: Unterminated string constant
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:126)
at com.google.gwt.dev.shell.ie.MethodDispatch.invoke(MethodDispatch.java:97)
at com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:294)
at com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:194)
at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1925)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:720)
at com.google.gwt.dev.GWTShell.run(GWTShell.java:593)
at com.google.gwt.dev.GWTShell.main(GWTShell.java:357)
Possible Issue and Solution
The String you are sending back to the client contains newline or carriage returns in it. This makes the JavaScript gwt handler vomit on the client side.
What I did was replace the newline with a pipe which I then converted back to a newline in my UI display logic.
public CometPayload(String pLogMessage) {
//logMessage = pLogMessage;
logMessage = pLogMessage.replace("\r\n", "").trim();
}
Friday, April 17, 2009
Tuesday, January 6, 2009
Maven JNLP Jar Install Issue
While researching the creation of a POM for a JNLP Java Swing project, I came accross the following helpful Maven code to install a JNLP jar file via the command line:
mvn install:install-file -Dfile=%JAVA_HOME%\sample\jnlp\servlet\jnlp-servlet.jar \
-DgroupId=com.sun.java.jnlp -DartifactId=jnlp-servlet -Dversion=5.0 \
-Dpackaging=jar -DgeneratePom=true
This works fine if your %JAVA_HOME% variable doesn't contain whitespace. If it does, the Stacktrace below occurs.
Solution
Add double quotes to the file parameter as follows:
mvn install:install-file -Dfile="%JAVA_HOME%\sample\jnlp\servlet\jnlp-servlet.jar" -DgroupId=com.sun.java.jnlp -DartifactId=jnlp-servlet -Dversion=5.0 -Dpackaging=jar -DgeneratePom=true -e
Stacktrace
mvn install:install-file -Dfile=%JAVA_HOME%\sample\jnlp\servlet\jnlp-servlet.jar \
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task 'Files\Java\jdk1.6.0_06\sample\jnlp\servlet\jnlp-servlet.jar': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: <>
[INFO] Finished at: Tue Jan 06 11:02:13 CST 2009
[INFO] Final Memory: 1M/4M
[INFO] ------------------------------------------------------------------------
C:\JBuilder2007\workspace\H2HAdmin\bin>-DgroupId=com.sun.java.jnlp -DartifactId=jnlp-servlet -Dversion=5.0 \'-DgroupId' is not recognized as an internal or external command,operable program or batch file.
C:\JBuilder2007\workspace\H2HAdmin\bin>-Dpackaging=jar -DgeneratePom=true
References
http://mojo.codehaus.org/webstart/webstart-maven-plugin/jnlp101.html
mvn install:install-file -Dfile=%JAVA_HOME%\sample\jnlp\servlet\jnlp-servlet.jar \
-DgroupId=com.sun.java.jnlp -DartifactId=jnlp-servlet -Dversion=5.0 \
-Dpackaging=jar -DgeneratePom=true
This works fine if your %JAVA_HOME% variable doesn't contain whitespace. If it does, the Stacktrace below occurs.
Solution
Add double quotes to the file parameter as follows:
mvn install:install-file -Dfile="%JAVA_HOME%\sample\jnlp\servlet\jnlp-servlet.jar" -DgroupId=com.sun.java.jnlp -DartifactId=jnlp-servlet -Dversion=5.0 -Dpackaging=jar -DgeneratePom=true -e
Stacktrace
mvn install:install-file -Dfile=%JAVA_HOME%\sample\jnlp\servlet\jnlp-servlet.jar \
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task 'Files\Java\jdk1.6.0_06\sample\jnlp\servlet\jnlp-servlet.jar': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: <>
[INFO] Finished at: Tue Jan 06 11:02:13 CST 2009
[INFO] Final Memory: 1M/4M
[INFO] ------------------------------------------------------------------------
C:\JBuilder2007\workspace\H2HAdmin\bin>-DgroupId=com.sun.java.jnlp -DartifactId=jnlp-servlet -Dversion=5.0 \'-DgroupId' is not recognized as an internal or external command,operable program or batch file.
C:\JBuilder2007\workspace\H2HAdmin\bin>-Dpackaging=jar -DgeneratePom=true
References
http://mojo.codehaus.org/webstart/webstart-maven-plugin/jnlp101.html
Monday, October 20, 2008
On Web Frameworks
Sometimes, picking the best framework for a particular project given so many great choices is difficult. Most shops have standards that guide such selections, taking into consideration how well a framework fits into the organizations best practices and knowledge expertise. I love open source and don't mind bleeding a little bit, so long as security isn't compromised. I can't wait to see how the Spring MVC project turns out. So far, so good.
Monday, October 13, 2008
Too Much Bleeding?
We are exploring Spring MVC with JQuery now to keep things simpler for our small interface to a new transaction processing network gateway application. I can't deny that I'm dissappointed...a little more effort and late nights would have yielded the results we were seeking using our original design; however, the suits want to software one month sooner than expected, so its time to put something together without all the bells and whistles.
Wednesday, September 24, 2008
On Server Push Technologies
The issue with Active MQ was a typo in an example they provided; I ended up joining Confluence in an attempt to correct errors as I discovered them. In the end, I almost became an expert in embedded brokers (didn't need to really go there).
Wednesday, September 10, 2008
Struts 2 - Small Preview Successes
So no luck still connecting JBoss to ActiveMQ on a separate server but won't give up. There was some partial success binding a Queue (no stacktrace vomit), but haven't tested it yet so can't say this piece is over.
I'm looking also at Struts 2 for a small web application we're creating at work. After using the Maven archetype for the starter application, I successfully used the Jetty mojo that came included in the pom.xml file. A small thing - the example they have online published on Apache in the Creating an Application Using an Archetype section doesn't work. I had to change:
Setting up the development environment for this new project at work hasn't been easy, but I'm getting closer. Struts 2 seems like a good thing - I said the same about the Shale framework which was supposed to be Struts's evolution. I guess Struts 2 has a better chance at infiltrating the development world because of the name.
I'm looking also at Struts 2 for a small web application we're creating at work. After using the Maven archetype for the starter application, I successfully used the Jetty mojo that came included in the pom.xml file. A small thing - the example they have online published on Apache in the Creating an Application Using an Archetype section doesn't work. I had to change:
-DarchetypeVersion=2.0.5-SNAPSHOT \I then installed the Maven pluggins for Eclipse so that I could see my source files to edit/play with them. But now, Eclipse is complaining about not seeing the JDK. I can't believe it doesn't use the JAVA_HOME enviornment variable. I know from dealing with this problem at work that I have to go modify an ini file or the Icon properties that launch the IDE, but jeez.
To
-DarchetypeVersion=2.0.11.2-SNAPSHOT
Setting up the development environment for this new project at work hasn't been easy, but I'm getting closer. Struts 2 seems like a good thing - I said the same about the Shale framework which was supposed to be Struts's evolution. I guess Struts 2 has a better chance at infiltrating the development world because of the name.
Tuesday, September 9, 2008
Integrating Active MQ with JBoss - Attempt 1
I have been trying to integrate JBoss with Active MQ for a few days now. I have found numerous how-to's on the net for embedding the Q broker using the same virtual machine, and even got an example to work after minor modifications using: http://activemq.apache.org/jboss-integration.html and http://activemq.apache.org/integrating-apache-activemq-with-jboss.html.
What I really need though is access opened to a remote Queue Broker. I thought it would as easy as setting up a data source, creating a few xml files, and adding a driver to the classpath on JBoss, but so far, no luck. I found some more clues and things to try. I'll post my findings as soon as I get the thing to work.
What I really need though is access opened to a remote Queue Broker. I thought it would as easy as setting up a data source, creating a few xml files, and adding a driver to the classpath on JBoss, but so far, no luck. I found some more clues and things to try. I'll post my findings as soon as I get the thing to work.
Subscribe to:
Posts (Atom)