Re: jsp page on Tomcat non loading css
On 11/7/2014 7:55 PM, Daniel Baktiar wrote: Hi Alessandro, Is there any servlet filter running which modifies the "Content-Type" headers? Look at the web.xml for tag. Daniel Baktiar On Thu, Nov 6, 2014 at 7:04 PM, Alessandro Panzeri < alessandro.panzer...@gmail.com> wrote: I deployed a war on Tomcat 7 to serve a jsp page. In the jsp page I put this css tag: Also, at the beginning of the jsp page I put this: <%@ page contentType="text/html;charset=utf-8" %> However when I contact via browser such jsp page, the css is NOT loaded and I found that the reason is (returned by Google Chrome inspecting the page): "Resource interpreted as Stylesheet but transferred with MIME type text/plain." I can't figure out what to modify...any advice? Hi, Alessandro- Something doesn't seem right to me. What is the URL you use to access the JSP page? What is the path name of your application directory? What is the path name of the CSS directory? -Terence Bandoian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem when rebooting....
Ok, did a thread dump that resulted in the following dump..: Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode): "localhost-startStop-1" #15 daemon prio=5 os_prio=0 tid=0x7fdc84002000 nid=0x702 runnable [0x7fdc8ebe7000] java.lang.Thread.State: RUNNABLE at java.io.UnixFileSystem.checkAccess(Native Method) at java.io.File.canRead(File.java:768) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1975) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1971) at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1922) at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1880) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771) - locked <0xc1395170> (a org.apache.catalina.startup.ContextConfig) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5120) - locked <0xc1394f40> (a org.apache.catalina.core.StandardContext) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) - locked <0xc1394f40> (a org.apache.catalina.core.StandardContext) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1703) at java.util
Re: Problem when rebooting....
2014-11-09 1:08 GMT+03:00 Bjørn T Johansen : > I have a init script I have been using now for severeal years that has been > working without any problems... > But since upgrading to Tomcat 8 (now 8.0.14), Tomcat is not coming up if I > boot the server.. > > Here is the output from catalina.out..: > > 08-Nov-2014 23:03:09.657 INFO [Thread-4] > org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler > ["http-apr-8080"] > 08-Nov-2014 23:03:09.724 INFO [Thread-4] > org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler > ["ajp-apr-8009"] > 08-Nov-2014 23:03:09.775 INFO [Thread-4] > org.apache.catalina.core.StandardService.stopInternal Stopping service > Catalina > 08-Nov-2014 23:03:10.089 WARNING [localhost-startStop-2] > org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The > web application [/kappskole] appears to have started a thread named > [Mojarra-WebResourceMonitor-1-thread-1] but has failed to stop it. This is > very likely to create a memory leak. Stack trace of thread: > sun.misc.Unsafe.park(Native Method) > java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) > > java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) > > java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093) > > java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809) > java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067) > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > java.lang.Thread.run(Thread.java:745) > 08-Nov-2014 23:03:10.097 INFO [localhost-startStop-2] > org.springframework.context.support.AbstractApplicationContext.doClose > Closing Root WebApplicationContext: startup date [Sat Nov 01 23:59:29 CET > 2014]; root of context hierarchy > 08-Nov-2014 23:03:10.104 INFO [localhost-startStop-2] > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons > Destroying singletons in > org.springframework.beans.factory.support.DefaultListableBeanFactory@7b584330: > defining beans > [saldo,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,dataSource,jdbcTemplate]; > root of factory hierarchy > 08-Nov-2014 23:03:10.128 WARNING [localhost-startStop-2] > org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web > application [/trumf] registered the JDBC driver [org.postgresql.Driver] but > failed to unregister it when the web application was stopped. To prevent a > memory leak, the JDBC Driver has been forcibly unregistered. > 08-Nov-2014 23:03:10.164 INFO [Thread-4] > org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler > ["http-apr-8080"] > 08-Nov-2014 23:03:10.216 INFO [Thread-4] > org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler > ["ajp-apr-8009"] > 08-Nov-2014 23:03:10.294 INFO [Thread-4] > org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler > ["http-apr-8080"] > 08-Nov-2014 23:03:10.295 INFO [Thread-4] > org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler > ["ajp-apr-8009"] > 08-Nov-2014 23:03:41.930 INFO [main] > org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache > Tomcat/8.0.14 > 08-Nov-2014 23:03:41.941 INFO [main] > org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 24 > 2014 09:01:51 > 08-Nov-2014 23:03:41.941 INFO [main] > org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.14.0 > 08-Nov-2014 23:03:41.942 INFO [main] > org.apache.catalina.startup.VersionLoggerListener.log OS Name:Linux > 08-Nov-2014 23:03:41.942 INFO [main] > org.apache.catalina.startup.VersionLoggerListener.log OS Version: > 2.6.32-504.el6.x86_64 > 08-Nov-2014 23:03:41.942 INFO [main] > org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 > 08-Nov-2014 23:03:41.943 INFO [main] > org.apache.catalina.startup.VersionLoggerListener.log JVM Version: > 1.8.0_25-b17 > 08-Nov-2014 23:03:41.943 INFO [main] > org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle > Corporation > 08-Nov-2014 23:03:43.325 INFO [main] > org.apache.catalina.core.AprLifecycleListener.init Loaded APR based Apache > Tomcat Native library 1.1.31 using APR version 1.3.9. > 08-Nov-2014 23:03:43.326 INFO [main] > org.apache.catalina.core.AprLifecycleListener.init APR capabilities: IPv6 > [true], sendfile [true], accept filters [false], random [true]. > 08-Nov-2014 23:03:43.
Problem when rebooting....
I have a init script I have been using now for severeal years that has been working without any problems... But since upgrading to Tomcat 8 (now 8.0.14), Tomcat is not coming up if I boot the server.. Here is the output from catalina.out..: 08-Nov-2014 23:03:09.657 INFO [Thread-4] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-apr-8080"] 08-Nov-2014 23:03:09.724 INFO [Thread-4] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-apr-8009"] 08-Nov-2014 23:03:09.775 INFO [Thread-4] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina 08-Nov-2014 23:03:10.089 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [/kappskole] appears to have started a thread named [Mojarra-WebResourceMonitor-1-thread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093) java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809) java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) java.lang.Thread.run(Thread.java:745) 08-Nov-2014 23:03:10.097 INFO [localhost-startStop-2] org.springframework.context.support.AbstractApplicationContext.doClose Closing Root WebApplicationContext: startup date [Sat Nov 01 23:59:29 CET 2014]; root of context hierarchy 08-Nov-2014 23:03:10.104 INFO [localhost-startStop-2] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7b584330: defining beans [saldo,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,dataSource,jdbcTemplate]; root of factory hierarchy 08-Nov-2014 23:03:10.128 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [/trumf] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 08-Nov-2014 23:03:10.164 INFO [Thread-4] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-apr-8080"] 08-Nov-2014 23:03:10.216 INFO [Thread-4] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-apr-8009"] 08-Nov-2014 23:03:10.294 INFO [Thread-4] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-apr-8080"] 08-Nov-2014 23:03:10.295 INFO [Thread-4] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-apr-8009"] 08-Nov-2014 23:03:41.930 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.14 08-Nov-2014 23:03:41.941 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 24 2014 09:01:51 08-Nov-2014 23:03:41.941 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.14.0 08-Nov-2014 23:03:41.942 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:Linux 08-Nov-2014 23:03:41.942 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 2.6.32-504.el6.x86_64 08-Nov-2014 23:03:41.942 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 08-Nov-2014 23:03:41.943 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_25-b17 08-Nov-2014 23:03:41.943 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 08-Nov-2014 23:03:43.325 INFO [main] org.apache.catalina.core.AprLifecycleListener.init Loaded APR based Apache Tomcat Native library 1.1.31 using APR version 1.3.9. 08-Nov-2014 23:03:43.326 INFO [main] org.apache.catalina.core.AprLifecycleListener.init APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 08-Nov-2014 23:03:43.651 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013) 08-Nov-2014 23:03:44.102 INFO [main] org.apache.coyote.AbstractProtocol.init Initializi
Re: Spurious Problem starting Tomcat7 (garbled class names)
2014-11-06 19:33 GMT+03:00 Matthias Keller : > Hi > > We have a spurious problem which still happened quite a few times but is not > really reproducible since it only occurs on every 1000. startup or > something. > The effect is that tomcat scans all class files but somewhere something goes > wrong and it tries to load an invalid class name which is often a > combination of two effectively existing class names. > It is confimed to occur on 7.0.55 with Java7, however it's likely not to be > bound to a single version as we've seen it at different sites lately. > > example with to garbled classes: (3.class being the first, which must come > from SomeClass$3.class and the second one being something awefully > beautiful: > ConfigEdiAtourtAhpepnltiiccaattiioonn$SAtpaptlei$cIadteinotniCfo^@^@iigeLro.acdlLaissstener.class > ) > > INFO: Starting Servlet Engine: Apache Tomcat/7.0.55 > Oct 28, 2014 10:13:15 AM org.apache.catalina.startup.HostConfig deployWAR > INFO: Deploying web application archive /opt/tomcat/webapps/test-admin.war > Oct 28, 2014 10:13:22 AM org.apache.catalina.startup.ContextConfig > processAnnotationsJndi > SEVERE: Unable to process resource element > [jndi:/localhost/test-admin/WEB-INF/classes/ch/something/3.class] for > annotations > java.io.FileNotFoundException: > jndi:/localhost/test-admin/WEB-INF/classes/ch/something/3.class > at > org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:389) > at > org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1994) > at > org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1986) > at > org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1986) > at > org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1986) > at > org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1986) > at > org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1902) > at > org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1298) > at > org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876) At that place Tomcat essentially asks you hard drive for the list of files in WEB-INF/classes directory and opens each file that has name ending with ".class". Essentially the directory listing returns some garbage. I do not think that Tomcat code is responsible for that. Is your hardware OK? Is it a local harddrive, or a network one? > https://issues.apache.org/bugzilla/show_bug.cgi?id=57173 Bug 57173 is irrelevant here. (Bug 57173 occurs when parsing a class file. In this case the parsing has not been started yet. It failed when trying to open the file). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: isELIgnored default is wrong
>> I worked around the problem by adding the following to the JSP >> files: >> >> <%@ page isELIgnored="false" %> >> >> However, I'd like to understand where the configuration error is >> occurring as from my perspective nothing changed except OS and >> Tomcat version. My own efforts have turned up nothing helpful or >> illuminating. >> >> Where should I be looking in the configurations for a difference? >> What differences would come into play? > > What is your tag library declaration in your JSP file? That's probably > the most important thing, here. Are you supplying your own version of > JSTL, EL, etc. along with your web application? > +1. There have been several user reports when Apache Maven packed conflicting API implementation jars into a war file. I do not remember it resulting in such symptoms, but things were going awry for those affected. I would suggest trying the following: 1) Add logEffectiveWebXml="true" to your Context and see how that web.xml is actually interpreted by Tomcat (considering all web fragments and annotations) http://tomcat.apache.org/tomcat-7.0-doc/config/context.html 2) Run in "strict servlet compliance" mode. That will enable validation of your web.xml against schema. http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Specification 3) Are there any errors, warnings in the log files? If that does not help, then maybe a) inspect the java code generated for your JSPs b) run with a debugger https://wiki.apache.org/tomcat/FAQ/Developing#Debugging c) try with 7.0.42 on Windows, and then with intermediate versions up to 7.0.56 to see when the problem appeared. d) test with 7.0.57 (a release candidate is currently in the voting process on dev@) e) simplify your web application until you have a reproducible test case that you can show others The examples webapp has EL on its pages and those are certainly working. f) update you web.xml to version 3.0 and configure it to avoid annotation scanning https://wiki.apache.org/tomcat/HowTo/FasterStartUp Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: jsp page on Tomcat non loading css
2014-11-06 14:04 GMT+03:00 Alessandro Panzeri : > I deployed a war on Tomcat 7 to serve a jsp page. > > In the jsp page I put this css tag: > > > > Also, at the beginning of the jsp page I put this: > > <%@ page contentType="text/html;charset=utf-8" %> > > However when I contact via browser such jsp page, the css is NOT loaded and > I found that the reason is (returned by Google Chrome inspecting the page): > > "Resource interpreted as Stylesheet but transferred with MIME type > text/plain." > > I can't figure out what to modify...any advice? It means that server accompanies your CSS file with HTTP protocol header "Content-Type: text/plain" while the browser expects it to be "Content-Type: text/css". The contents of your JSP page and your tag are irrelevant. You cannot solve this by modifying your JSP or CSS files. The mime type for static files is usually configured by elements in your web.xml. Either you have those wrong, or your CSS is not a static file, or something else modifies your Content-Type header (e.g. a Filter). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org