angular application getting an error from a tomcat application - java

I have an angular 2 application that makes http get calls to a tomcat server (Java).
when I make the call, in the browser console, I see a long error ending with
Not sure what the cause is and what the solution might be.
Anyone dealt with this before?
Sorry, JavaScript must be enabled in order for you to use this application.

In case you have error JavaScript must be enabled... than you need to turn JavaScript on.
Go to Delop tools (F12) and go to settings in the top-right corner of the window.
In preferences go down to Debugger you will have checkbox to Disable JavaScrip

Related

Debugging web service with Intellij

I work with a web service (SOAP) that is installed on a remote server (Websphere). Since I do not fully understand its operation, I would like to use debugging to understand the code step by step. I want to use the local instance Intellij (ultimate). My problem is that due to little experience I do not know how to do it. I have questions:
to check the operation of WS I want to send queries to the server using SOAPUI. Is there a possibility for me to look at Intellij (using breakpoints) what values are returned at a given stage?
how to connect it all together?
is there a different, better way to check the code?
First, make sure that debug is enabled on your remote server. This can probably be configured in Websphere. Then, in IntelliJ select the "run configurations" dropdown and "Edit Configurations". Hit the "+" and select remote. Set the correct host and port, and click "OK". Then, start the run configuration in debug mode, add some breakpoints and debug away!

GWT RPC call gets repeated after 30 seconds

I am experiencing a weird problem in a GWT application. I have multiple RPC calls which work correctly, however if one of them takes longer than 30 seconds on the server side (for example a database or web service call took a long time), the server side code gets repeated (literally; the code get executed again).
I do not experience this in my develompent environment, however when I deploy the application (container is Jetty 6.1.24 on Ubuntu 12.04 LTS) and connect to it from a browser (regardless of the type), the problem starts to exist.
Since I do not think this a designed GWT behaviour (but I might be wrong ofcourse) I am basically looking for ways to debug this and find out the reason for it. Thanks in advance!
Some more information would be great to understand what is going on, but I would start the investigation by first narrowing down whether the erroneous GWT-RPC call is triggered on the client or server.
To see if the extra GWT-RPC request originates from the browser, in Google Chrome, go to View->Developer->Developer Tools.. Click on the Network Tab.
As you reproduce your steps, the Network Tab will show you every request sent to the server.
If you see the erroneous GWT-RPC request logged in this Network Tab View, then the request is fired off from the GWT-compiled Javascript in the application. With SuperDevMode, you can then set debug breakpoints in the browser and see what is triggering the request.
If the erroneous GWT-RPC is not shown in the Network Tab View, then the server-side method is somehow triggered by your server code/configuration. Set some debug breakpoints on your server code, and drill down the call stack to see what is calling the method.
Hope that helps to get started on the investigation.

JavaEE application throws HTTP 408 when debugging application with eclipse

currently I'm starting to learn JavaEE. I created a simple donation-management-system which is secured by a login form. In the past I've just deployed my code to JBoss AS 7.1.1 and accessed it via browser.
However I would like to debug my application using Eclipse, as my application is starting to get bigger. I found several tutorials on the web and here at so but they didn't bring the expected result.
Here is what I did:
I edited the "standalone.conf.bat" and uncommented the line
set "JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
Then I created a new "Remote Java Application"-Configuration in Eclipse using localhost as hostname and 8787 as port.
Now my problem is as follows:
When I try to debug the application, the integrated eclipse browser opens up and show the expected web page, but when I enter the credentials and click "Login" I this exception:
HTTP Status 408 - The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser
When I open my application in f.e. Firefox everything works fine.
Any ideas how to fix that? I'm already getting grey hair..
Edit: For the Login-Form I use the j_security_check
Could potentially be an issue with the integrated browser in Eclipse. Perhaps it's not handling session cookies properly.
To eliminate that possibility, I believe that in your general Eclipse preferences you can change the "Web Browser" setting to an external web browser (like Firefox) and see if you still have the issue.

Problems with adding a GWT app in an iFrame

I have a GWT application, and I want to embed its URL in another web page through an iFrame:
<iframe src="http://127.0.0.1:8888/myProject.html?gwt.codesvr=127.0.0.1:9997"/>
But I'm getting errors.
If I browsed it in firefox:
Permission denied to access property 'href' (from firebug console)
If I browsed it in chrome:
A dialog pops up saying: Plugin failed to connect to Development Mode server at 127.0.0.1:9997
I researched a lot but all were in vain.
Using development mode of GWT.
Any help would be appreciated.
OK if someone ever get here cause
he has the same problem and want to know what happened
I will just summarize what we've got.
I'm not sure but I think that the problem was because internet browsers don't let sites to access url that are not in the main page domain (if it was able to do so very bad things would have happened) unless you let them do so.
It's called cross-domain access policy, so there are 2 options for handling it
The easy one- the gwt and the outer html must have the same host.
Let gwt plugin run from the outer html context, it's described here and here but for some reason it wasn't working. we still don't know why.
My workaround (Ubuntu, GWT 2.5.1) was to replace:
__gwt_HostedModePlugin -> parent.__gwt_HostedModePlugin
window.top -> window.parent
in hosted.html

GWT force Update on Server during development mode

I am getting a really annoying problem. In my application, whenever i need to change client code, the refresh make the new fix works
However, when editing server code, i need to stop the current application and run again. When the application is big, this takes a little time.
Is there a way to force update the current running server code???
i need to stop the current application and run again
[...]
Is there a way to force update the current running server code???
Absolutely! It's not necessary to stop the server when you need to refresh the server side code: In the "Development Mode" view (in Eclipse), click the icon with the two yellow arrows. This application reload is much quicker than a server restart.
If you are using Eclipse run your back-end application in debug mode instead of run mode and that usually gets you a little closer due to its incremental compiler.
Check this out on how to use an external server with GWT http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#How_do_I_use_my_own_server_in_development_mode_instead_of_GWT's
Run your server side code in some other server like tomcat. And start the gwt application in noserver mode. But if you change any rpc related classes in client side you have redeploy the code in tomcat server.

Categories