Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Changing java version Netbeans 7.1

 
Ranch Hand
Posts: 221
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.8


This both points to 1.6


I did: Netbeans – project – properties – libraries – java platform – choose ver of java - 8
and it seems it does not have any effect ?
 
Saloon Keeper
Posts: 10408
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you go to Tools -> Java Platforms, what platforms does it list, and which is the default?

By the way, have you considered updating NetBeans? The latest pre-Apache version is 8.2. Personally I prefer working with Apache NetBeans 10.
 
Miran Cvenkel
Ranch Hand
Posts: 221
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I have this in netbeans.conf

I think I had C:.....jdk1.6 ... and it worked anyway.

if I change that to where 8 is

net beans does not start, first screen hangs for a bit and then disapears.


By the way, have you considered updating NetBeans?


had to many troubles with that long time ago.
 
Stephan van Hulst
Saloon Keeper
Posts: 10408
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you're also having troubles now, so you might as well take the time to install a new NetBeans version.
 
Miran Cvenkel
Ranch Hand
Posts: 221
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm now at the point:
Net beans 8
java 8
Tomcat 8

Two problems:
1.If start page is index.jsp, that page does not render, browser displays same thing (page source as text) as left click/view page source. Any idea how to sort that ?
I suspect setting catalina home & base in win envir. variables has something to do with that ? Now there are none. https://stackoverflow.com/questions/14579661/how-to-set-catalina-home-variable-in-windows-7/21750443
EDIT: this does not help
2.Net beans 1.8.0_2012 Library/edit/add jar/folder - I can hear disk producing strange quiet 'choking' sounds and file system does not display for a while, same thing at any folder change there. Win7.

 
Stephan van Hulst
Saloon Keeper
Posts: 10408
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never had to do anything with environment variables at all to get Tomcat running properly.

Honestly, there's not much we can do to help you without seeing your web.xml and, if you're using Maven, your pom.xml.
 
Miran Cvenkel
Ranch Hand
Posts: 221
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose you want to see tomcat web.xml.
Atached original that came with 8.5.43 Tomcat and current mine. Not much difference.
Hmm, can't attach, so here they are:
https://gofile.io/?c=SLMWEO


note also same problem as mine: https://stackoverflow.com/questions/4697654/jsp-displaying-source-code-instead-of-executing
 
Stephan van Hulst
Saloon Keeper
Posts: 10408
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, the web.xml of your application, not of Tomcat. If you don't have a web.xml, I'm assuming you're using Servlets 3.0+?
 
Miran Cvenkel
Ranch Hand
Posts: 221
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Stephan van Hulst
Saloon Keeper
Posts: 10408
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, why do you have so many servlets? Don't you want to use an MVC framework that has a single servlet that dispatches requests to controller classes?

Anyway, give us an example of an URL that wrongly displays the result, and show us the corresponding servlet class.
 
Miran Cvenkel
Ranch Hand
Posts: 221
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if I create new web app it's index html shows fine, but see this (after kill java process + debug webapplication)
Looks like there is one general (invoker ?) problem, not app itself ?


[localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
01-Aug-2019 00:05:48.715 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
01-Aug-2019 00:05:48.725 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@d9c4e1')
01-Aug-2019 00:07:18.873 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log SessionListener: contextDestroyed()
01-Aug-2019 00:07:18.873 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log ContextListener: contextDestroyed()
01-Aug-2019 00:07:19.113 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
01-Aug-2019 00:07:19.113 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
01-Aug-2019 00:07:19.113 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@6d6a4e')
01-Aug-2019 00:07:58.051 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log Marking servlet [invoker] as unavailable
01-Aug-2019 00:07:58.051 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.StandardContext.loadOnStartup Servlet [invoker] in web application [] threw load() exception
java.lang.ClassNotFoundException: org.apache.catalina.servlets.InvokerServlet
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:536)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:527)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1032)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:973)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4885)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5199)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3759)
at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1395)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1368)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1603)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:304)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1159)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1385)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1353)
at java.lang.Thread.run(Thread.java:748)
01-Aug-2019 00:07:58.051 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log SessionListener: contextDestroyed()
01-Aug-2019 00:07:58.051 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log ContextListener: contextDestroyed()
01-Aug-2019 00:07:58.281 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
01-Aug-2019 00:07:58.281 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
01-Aug-2019 00:07:58.281 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@efa395')
01-Aug-2019 00:07:58.291 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.ApplicationContext.log Marking servlet [invoker] as unavailable
01-Aug-2019 00:07:58.291 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.core.StandardContext.loadOnStartup Servlet [invoker] in web application [/examples] threw load() exception
java.lang.ClassNotFoundException: org.apache.catalina.servlets.InvokerServlet
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:536)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:527)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1032)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:973)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4885)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5199)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3759)
at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1395)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1368)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1603)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:304)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1159)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1385)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1353)
at java.lang.Thread.run(Thread.java:748)

              ..................... etc.
 
Stephan van Hulst
Saloon Keeper
Posts: 10408
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The example web application is using InvokerServlet, which was already deprecated in Tomcat 6. Show us the web.xml and the example application.

Again, why are you not using an MVC framework? It will make your life much much easier.
 
Miran Cvenkel
Ranch Hand
Posts: 221
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW, I suppose this in tomcat web xml is same thing
T 5


T 8


Now, I had in app web.xml



Commenting this out solves the problem: "JSP displaying source code instead of executing", i.e. jsp-s renders at it should, but jspf-s does not, they print out as source.

Any tip ?


 
Miran Cvenkel
Ranch Hand
Posts: 221
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The solution is to put everything into tomcat web.xml. Like:
 
Stephan van Hulst
Saloon Keeper
Posts: 10408
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad you managed to get it to work.

For future reference, please be specific about the problem you're having. You said "JSP displaying source code instead of executing". You didn't say that JSP pages were fine, but JSP Fragments weren't rendering properly.
 
Miran Cvenkel
Ranch Hand
Posts: 221
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"JSP displaying source code instead of executing


That was correct statement. It appears that app web xml setting overrides that from tomcat web.xml at tomcat 8. So there was no correct mapping for.jsp and jsp did not render.
While that was working OK under tomcat 5.
 
Stephan van Hulst
Saloon Keeper
Posts: 10408
223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right, but I'm confused by your observation that "jsp-s renders as it should, but jspf-s does not", which contradicts "there was no correct mapping for .jsp and jsp did not render".

It doesn't matter anyway, your solution to fix the Tomcat web.xml appears correct to me.
 
I can't take it! You are too smart for me! Here is the tiny ad:
Java Code Review and Psychology
https://coderanch.com/t/714798/java/Java-Code-Review-Psychology
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!