Why doesn't Tomcat Server have latest HTML updates? - java

I'am trying to run this project on my local host.
I followed these instructions on how to launch a dynamic web project on Tomcat Server.
Everything works and when I run the application, I see this which is correct
Now I'am trying to play around with the code a bit. I located the html code that corresponds to the new wine page - /WebContent/tpl/wine-details.html
I changed the country label to show states instead.
However when I re run the web application on the Tomcat Server, the label still says country.
Does anyone know what the issue is? I made sure to save the file. What I also found interesting was there were two copies of this file, in backbone-jax-cellar and backbone-jax-cellar-master. I made sure that both copies contained the states label.

If anyone's having this issue still, I recommend just visiting the URL in a web browser. I used Chrome and everything is showing up fine.
I think the problem here is that Eclipse is somehow caching the html page and doesn't update it when it runs the web app

Related

Resources not properly loaded on Oracle BI Web Service

I am trying to create a Java + Maven app that uses the Oracle Business Intelligence (BI) Web Service to render an analysis using HTMLViewService. So far I've been using the GO URL without problems, but I want to migrate to Web Services for security reasons.
I am using Oracle Business Intelligence Product Version 12.2 as BI Server and Tomcat 9.0.34 as webserver.
My problem is that the resources are not properly rended/loaded. I can't figure out what I'm doing wrong in my implementation.
TLDR:
Full code and how to reproduce the problem locally on GitHub.
Here is the report displayed directly in the BI server:
And here is the report shown in my application:
As you can see, the dropdown arrow was not displayed, also the CSS for buttons Refresh, Print, Export was not applied. In the console window I got:
Network tab:
Application tab:
It looks like fcustom.css file is directly importing 2 css files: master.css and facustom.css. Also some .png files are missing. The application looks for them directly in the root of our server instead of using the bridge. Why aren't all resources going through the bridge servlet?
I managed to overcome the above problem by manually putting those resources in WebContent folder, but this is a dirty solution and it's still not fully functional. Some analysis still do not render at all, export is giving errors etc. as shown on GitHub.
Any help will be highly appreciated!

The module hasn't been compiled yet

I have GWT-Maven project created using IntelliJ. I can build and run it but the browser shows a strange error on home page. How to fix it?
I've tried to create new project and import the existing code but it doesn't help.
Project download: GwtStudy
You need to run it GWT Development mode with Jetty.
The you will get a code server at http://127.0.0.1:9876/
and a web server at: http://127.0.0.1:8888/yourapp.html
See also this video: https://www.youtube.com/watch?v=kx9RxrQZnFA
The tutorial is slightly misleading. You need to run the app by choosing "GWT Development mode with Jetty" and not "GWT development mode" as one may believe following the tutorial (the super dev mode is the standard nowadays).
If you run the app using "GWT development mode" you will start only the code server, that will run the java code, but it will not be able to serve the html page that hosts the stockwatcher application.
If you run it with "GWT Development mode with Jetty" you will get a code server at http://127.0.0.1:9876/ AND the web server at: http://127.0.0.1:8888/stockwatcher.html, that is the URL that you need to open with your browser to see the page that hosts the app (you can see that the docs shows the browser opening the url at port 8888 and not at port 9876).
The answer of Jankos is right but for me it was not enough clear. The video is not strictly needed or related to solve the issue, so I added this answer to help gwt beginners like me.
This is the CodeServer, which compiles your app on-demand, and serves the compiled scripts and their source maps.
You need another web server to serve your webapp, including most importantly an html page that includes the nocache.js script.
Depending on how you "run" your app this may or may not already be the case (you'd need to give more information).

com.mysql.jdbc.Driver class not found when opening Java Applet in web browser

I'm working in Netbeans, developing a Java Applet, as well as a few simple HTML pages that take the form of a Netbeans Web Application. I make a MySQL database connection within the code of my applet. This has been working fine for about a day now (I added the necessary .jar) and I have seen changes in the database as a result of testing, both when I attempt to run the applet straight from Netbeans, and when I run the web application from Netbeans and use the applet embedded in my HTML. However, I recently have been getting a ClassNotFoundException after calling the line:
Class.forName("com.mysql.jdbc.Driver");
in my applet code via the Web Application. Note that this line still executes successfully when I run the applet and not the web application. Only accessing the applet in Firefox is giving me these troubles. I tried restarting Netbeans and Firefox, and still no luck.
I apologize for the vagueness of the question, I was just hoping someone else might have experienced this and would know what to do. I'm pretty sure I haven't changed any code that is related to this Exception (given that the Applet still runs smoothly when not HTML-embedded), so that's all the relevant information I can think to give.
You need to let applet know about library with jdbc driver. Here is how to do it:
Adding a Third Party Library to Java Applet

Website development and testing in Eclipse and Tomcat: javascript is cached

I'm developing a web application with jsp pages in Eclipse 3.7.2 and testing it with Tomcat v6.0.
I've almost the perfect environment as all changes to my jsp or java code are immediately available in the browser within Eclipse, so I can directly test any change.
But... I also use jQuery, who isn't ;-), and changes in my javascript files are not immediately active. Looks like they are cached or copied once and don't get replaced. Even after rebuilding or restarting the tomcat, the old files keep being used.
Any ideas on how to solve this?
Thanks a lot,
Frank
If you are using firebug in your browser, you can switch off the caching by default without adding code to your page:
click the arrow on the right side of the Networking button and select the disable browser cache option.
The files are probably cached by the browser.
ctrl-F5 might help but if you can configure the server to set no cache for js and css that should also help.
Another solution is to load all such files through a loader,
/load.<site extension, ex php>?file=myscript.js
And have that "proxy" set no cache.
We use that along with e-tag to be able to use build number as e-tag, vith every build a new version is forced to clients but then cached until next build.

Why does GWT sometimes successfully compile and other times just stall?

I am working on a demo for a client of what's possible with GWT-Ext for GWT. After browsing for the simplest way to get up and running, I decided on installing the Google Plugin for Eclipse and using the New Web Application Wizard.
First time around, I followed these steps for create the default application:
Selected File > New > Web Application Project from the Eclipse menu.
In the New Web Application Project wizard, entered a name for the project (ExtDemo) and a java package name, com.extdemo.
Unchecked the "Use Google App Engine" check box.
Clicked Finish.
Right clicked it in package explorer and selected Run As > Run Configurations
Put a check in the Automatically Select Unused Port checkbox.
Clicked Run to see the default GWT 1.7 application
This worked fine... it launched GWT's hosted browser and the app worked as supposed to.
(I then continued to import GWT-Ext and add all sorts of widgets building up a nice little demo app)
However at some point when relaunching the app in hosted mode, the hosted browser displays an empty iframe. I even reverted the code to a point where everything was working as supposed to and... same thing, an empty iframe with the surrounding static content.
Now what is really strange is when I go through the process of creating the default application again by following the steps above, the hosted browser launches with an empty iframe again.
However when I click on Compile/Browse, this sometimes allows the app to launch in Firefox.
Anyone have this happen to them?
I have seen some odd behaviors occasionally. Here are some basic suggestions (some are dumb and you might have tried them already):
Use a new workspace
I do not know if GWT plugin somehow caches stuff in the embedded Jetty. If you are re-creating the default app/project, try and use a different name for the project.
Try and re-use a fixed port so that there is no possibility of having multiple servers running.
Update: Found a new "classic" solution:
Delete the cache in IE and possibly Firefox too. Apparently the 'script' tag content tends to be cached by IE. If this works, we can all try tearing our hair out!
Found the updated answer at this link:
I have had the same problem in the past and found it is much more likely to happen if limited CPU is available. For example if my older laptop was running on battery and had stepped down the CPU speed to save power it frequently happened. When running on mains in max performance mode it only happened occasionally. Now I have a much newer and more powerful laptop and the problem has gone away.
Another cause I found was too many breakpoints set up in eclipse and removing breakpoints would often clear the problem.
I've had issues with the browser caching.
Try clearing your browser cache, refresh a few times after a failed load, etc.
You can also try using a different port so the URL is different.
It takes some time to download and run the GWT app, particularly if you are using extra libraries, so wait for a few seconds to see if the app finally loaded.
What makes the app loading to fail randomly is something I don't know yet, but I suspect, as stated by Daniel Vaughan, that is related with a lack of computer resources, CPU, memory, etc.

Categories