GWT site works fine but will not render in SuperDevMode - gwt

I have spent the day trying to get my GWT 2.6 project to use SuperDevMode. I got to the point where I can get SuperDevMode, codeserver etc fired up in Chrome (Also tested in Firefox, linux and windows) however no amount of research seems adequate to progress me beyond the point I'm stuck on:
The site works fine when run as a normal server, (And it used to work fine in Classic Devmode) I'm reasonably convinced there's nothing fundamentally wrong with it, but as soon as I switch to SuperDevMode the GWT module won't load. I get the static content only.
First off I found an error in the Console of Chrome Developer Tools. I get a stack trace that claims that the method getCalendarFactory of my ClientFactory can't be called on an undefined reference (But again, without SuperDevMode this doesn't happen)
Uncaught com.google.web.bindery.event.shared.UmbrellaException: Exception caught: Exception caught: Exception caught: (TypeError) : Cannot read property 'getCalendarFactory' of undefined
SimpleEventBus.java:203
$doFire_0 SimpleEventBus.java:203
$fireEvent_1 SimpleEventBus.java:88
fireEvent_7 SimpleEventBus.java:52
$goTo PlaceController.java:156
$handleHistoryToken PlaceHistoryHandler.java:192
$handleCurrentHistory PlaceHistoryHandler.java:118
$onModuleLoad XXXAppController.java:62init_1 com_00046XXX_00046XXX_00046XXX__EntryMethodHolder.java:3
apply_0 Impl.java:283
entry0 Impl.java:347
(anonymous function) Impl.java:92gwtOnLoad XXX-0.js:46819
(anonymous function) Comparators.java:32
I've looked very hard through this but I'm still at a loss to understand the stack trace. After a few hours I decided to comment out a line from my AppController class (Which is serving as the entry-point in the gwt.xml):
// historyHandler.handleCurrentHistory();
However now when I load the page in SuperDevMode, I don't get the exception anymore, I get nothing except static content, no errors or output from the GWT module, so the UmbrellaException is gone but nothing else has changed really.
Any help or direction would be very gratefully received.

Did you use maven? If that's the case, have you lunch your superDevMode server on a container as Tomcat/Jetty ?
To see if your superDevMode's server works, you need to go to the url "127.0.0.1/9876". If you have no server which responds that's your superDevMode is not lunch.
More information on :
http://www.gwtproject.org/articles/superdevmode.html

Related

JSF 2.2 misspelled redirect doesn't generate an error

I'm converting an app written in JSF 1.1/ADF faces to JSF 2.2 (Mojarra) /Primefaces and converting all of the faces-config navigations to inplace (implicit?).
I just spent two hours debugging why the redirect:
"blahbla?faces-redirect=true"
wasn't working. Turns out it was supposed to be
"blahblah?faces-redirect=true"
I'm not sure why I didn't get some sort of error. Web developer didn't show anything, nothing in the logs - and my logs are working fine. The only indication was a lack of an error message but nothing redirecting.
Searching, I found only this
You only need to keep in mind that the new JSF 2.0 provided implicit
navigation doesn't scan for the presence of the file,...
Migrating from JSF 1.2 to JSF 2.0
I guess I expected a "404" type of error if the redirect page didn't exist. I told the server to display a page that doesn't exist, so some error must of raised and then discarded somewhere?
Is there some setting - maybe in web.xml - that will help display this type of coding error? Or anything else?
I just need it for dev.
PS. I did check the file name by copying it from the code and pasting it into the term but I made the mistake of using tab completion and of course it completed. If I had just put .xhtml on the end I would have seen the missing char.
if it helps, I'm running Tomcat 7

STACK_MESSAGE error thrown by NetSuite

Recently I've been getting an Error from NetSuite. We have a Custom Restlet which is receiving a JSON which is used to create Sales Order inside of NetSuite. In SandBox it worked fine so far, but in production not.
Error:
STACK_MESSAGE: java.lang.IllegalStateException: wrap should never be called unless shutter.visibleToScripts is called first.class com.netledger.app.common.scripting.nlobjError/class java.lang.Class
Can anyone help me with this?
NetSuite has this cute little thing where it throws Java exceptions when running JS. My presumption is that the JS is compiled as Java before being run, so sometimes you can get unhandelable execptions like this one (or having fixed sized arrays in JS.. crazy right!).
IllegalStateException
Signals that a method has been invoked at an illegal or inappropriate time.
http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/java/lang/IllegalStateException.html
What you can do is try doing some unit testing to find out what part of your code is causing the bug, then try to find a workaround as if it were Java code.

Brunch `require` not defined

I have an application that uses brunch, chaplin, and coffeescript for the front end. Brunch builds the application without any errors. However, when I do brunch watch --serverand navigate to http://localhost:3333, an error is generated and the page never loads.
This was previously working just fine. diff shows no changes in the repository that would account for the change in behavior. I also checked out previous versions of the front end code from when I know the dev. server was working, but they all give the same error. I tried deleting the built code and completely rebuilding, but that didn't help either.
I am thinking it must be something I did in an untracked file, but for the life of me, I can't find it. Here is the output of the chrome error message:
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3333/pub/css/app.css". localhost/:10
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3333/pub/js/vendor.js". localhost/:11
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3333/pub/js/app.js". localhost/:20
Uncaught SyntaxError: Unexpected token < vendor.js:1
Uncaught SyntaxError: Unexpected token < app.js:1
Uncaught ReferenceError: require is not defined (index):21
(anonymous function) (index):21
The offending line in index appears to be
<script>require('initialize');</script>
This line is unchanged from other similarly configured projects that work perfectly. I assume it is probably something dumb, but it is just vague enough that web search hasn't helped much. Hopefully someone else has come across this.
What can I do do diagnose the problem or fix this?
You have to confirm, but I believe you are getting 404 errors on your JavaScript and Stylesheets, so they are returning HTML pages that describe the 404 error. That's why that line of JavaScript is erroring out - it depends on code in app.js, which is not being loaded.
Make sure the paths are correct, i.e. point your browser to http://localhost:3333/pub/css/app.css and confirm that you get a CSS file and not a 404 from your web server. If you get a 404, that means you have to update the href for the CSS and the src for the JS, or make sure Brunch is placing the files where they are supposed to be.

GWT servlets not called at all

I have ported GWT basic Hello World application to jetty-maven-plugin based app.
Everything goes fine, gwt convert client side classes to Javascript and application run properly in dev mode but no response for server side servlet. I do not get any error or exception.
Any idea what is going wrong.
Thanks
There is not much information to gave 100% answer. But be sure to check:
Server log output (could be some exception there)
If there are no exceptions on server side open console in Firebug or Google Dev Tools and load the page in browser. Probably there will be 404 not found errors.
Check if your servlet is correctly defined in : war->WEB-INF->web.xml.
Definition of servlet is:
I'm sorry but I can't put code example. I don't understand why.
Anna

How do I debug Facelets page rendering issues?

I am using JBoss 7.1, Seam 2.2.2.
When rendering a page I am getting the Facelets debug page with a NullPointerException without any line number indicating where on the page it is occurring. Are there some standard tricks to debug such issues? I can't see any way to put in log statements, etc in this case.
Thanks!
This post may be helpful to you: https://stackoverflow.com/a/5458247/498531. Basically it lets you override a built-in Seam component to print a stacktrace of any exception thrown. It helped me once that I inadvertently had two toString() methods calling each other, and all I was just getting from the logs was a StackOverflowError, with no reference to any line of my code.