I have issues with MyEclipse BLUE 2013 SR1 for STRUTS2 when I try to launch it and I have no Internet connection. There are quite a few times when I am traveling and in an area where there is not a free WiFi hotspot around and I am trying to get some work done on a project - but I can't since MyEclipse crashes on start-up and gives me a dialog box pointing to a log file.
A copy of the log-file when this happens follows below:
SEVERE: Dispatcher initialization failed
Unable to load configuration. - http://struts.apache.org/dtds/struts-2.3.dtd:1:2
if internet is working project is working but without internet it is not loading ..Dispatcher initialization failed
Update
my java web project is not loading and showing following error if i disable my int
SEVERE: The markup declarations contained or pointed to by the document type declaration must be well-formed. at (-//Apache Software Foundation//DTD Struts Configuration 2.3//EN:1:2)
org.xml.sax.SAXParseException: The markup declarations contained or pointed to by the document type declaration must be well-formed.
SEVERE: Dispatcher initialization failed
Unable to load configuration. - http://struts.apache.org/dtds/struts-2.3.dtd:1:2
SEVERE: Exception starting filter struts2
Unable to load configuration. - http://struts.apache.org/dtds/struts-2.3.dtd:1:2
Umesh,
Having it crash on startup because there is no Internet connection is certainly unexpected and unusual.
1) By crash, do you mean that the workbench itself refuses to load or do you simply see an error message and can continue to use the IDE?
2) I'm assuming your Struts configuration file had been left open in the workspace when this happens?
We'll specifically try to test this case ourselves and let you know if we need more information. For direct support, do consider posting on the MyEclipse forums as well - http://myeclipseide.com/forums
Best,
Brian.
Related
I am new to servlets and using Tomcat version 7.0.34 (we were instructed to use this version only). My problem is that the Tomcat seems to restart at some point of time, this occurs when I don't interact with the servlet for some time. I see the following:
.
Further when I tried debugging through eclipse I see the following entries in the debug window:
Daemon Thread [http-bio-80-exec-1] (Suspended (exception RuntimeException))
ThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: not available
ThreadPoolExecutor$Worker.run() line: not available
TaskThread(Thread).run() line: not available
And this in console:
SEVERE: The web application [/csj] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.
Okt 03, 2016 1:39:39 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/csj] is completed
I want to know the reason why Tomcat is restarting. If I keep clicking the buttons with no delays, then this problem is not seen.
I tried looking here: Tomcat showing this error "This is very likely to create a memory leak". How to resolve this issue? and here: The web application [ROOT] is still processing a request that has yet to finish. [Tomcat] but I am at loss to understand.
It seems this problem is solved in newer version of Tomcat as per this:http://wiki.apache.org/tomcat/MemoryLeakProtection . Nevertheless I would like to understand what is this problem about.
Edit: Using eclipse-mars
Your tomcat is configured for "hot deploy" i.e. if you change code, tomcat will incorporate new code without a server restart. This can be configured on tomcat, or in eclipse. You can go there and disable this as it is actually a headache and consumes more time, and sometimes doesn't work correctly.
Tomcat loads each webapp using a separate classloader. It monitors your files for changes, and if a change happens, it unloads your webapp by destroying the classloader, and loads again using a new class loader. When this is happening, you will see all kinds of logs as you mentioned.
For eclipse configuration, see here
For tomcat configuration, see here
Also, from Tomcat docs, read this
In server.xml, set reloadable="false".
From https://tomcat.apache.org/tomcat-5.5-doc/config/context.html
Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.
I´m using hibernate 4.3.6 in my vaadin project.
Every time I make changes in the sources code, it is expected that the application builds again and the new source code is deployed automatically to Tomcat. In other words, Tomcat should reload its context.
The problem is that during this operation hibernate throws an error:
GRAVE: Exception loading sessions from persistent storage
org.hibernate.HibernateException: registry does not contain entity manager factory: myproject
at org.hibernate.jpa.internal.EntityManagerFactoryRegistry.getNamedEntityManagerFactory
(...)
After that log, i get:
24/09/2014 13:14:43 org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/myproject] is completed
However, I cannot continue using the website, since I receive a message saying that session is lost.
My question is: what is this hibernate exception and how can I solve it?
EDIT:
This error only happens when I store in session a JPA Entity, for example: the logged user
I don´t know any way to get what you want, in Tomcat, except with JRebel. The staff of Vaadin itself uses and recommends. Link with interesting information about Vaadin+JRebel: http://zeroturnaround.com/blog/jrebel-case-study-vaadin-eliminates-redeploys-and-saves-10-of-development-time/
If in the future you decide to use Jetty instead of Tomcat, you can make settings and get dynamic reloading of the application as suggested here: https://blog.oio.de/2012/08/23/dynamic-reloading-of-vaadin-applications-with-maven-and-eclipse /
I am using Netbeans 6.7 with Tomcat 6.0 and jasper reports for generating reports in a web application. I always get this exception when I run my application. can someone please help me out?
The exception is
INFO: Illegal access: this web application instance has been stopped already. Could not load org.apache.log4j.spi.NOPLoggerRepository. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:175)
at org.apache.log4j.LogManager.getLogger(LogManager.java:199)
at org.apache.log4j.Logger.getLogger(Logger.java:105)
at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:283)
at org.apache.commons.logging.impl.Log4JLogger.info(Log4JLogger.java:193)
at org.hibernate.connection.DriverManagerConnectionProvider.close(DriverManagerConnectionProvider.java:147)
at org.hibernate.connection.DriverManagerConnectionProvider.finalize(DriverManagerConnectionProvider.java:142)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
It could be due to a memory problem, I had this message and also a
java.lang.OutOfMemoryError: Java heap space, adjusting startup parameters to:
-XX:PermSize=512M -Xms1024m -Xmx4096m solved the problem the problem.
I found I would get a similar error occasionally while running my JSP web application with Netbeans on Tomcat and always while debugging it. In my case it was "could not load Java.lang.math or Oracle.lnx.lib". A coworker had me undeploy the web application instances from tomcat and it solved the problem. To undeploy a webapplication instance, go to the Services Tab > Servers and then double click on Apache Tomcat or TomEE and after running the application once since opening netbeans, a Web Applications Folder should appear. If you double click on that, you should see instances of your application appear. You should be able to right click them and then click undeploy (you may have to right click them and hit stop first). Finally, you should stop and then start tomcat before building and running your application.
Hope this helps.
I have a Java EE 5 application which consists of three web projects. I'm using JBoss 5.1 web server and NetBeans 7.2 IDE.
I have the following problems:
I cannot start application in Debug mode. That I know of, there are two (best) approaches in NetBeans and Java: Remote debugging and debugging via shared memory. I read this post How to debug JBOSS application in netbeans? and I set debug parameters in Jboss configuration(I also know there are different parameter sets for shared memory and remote debugging), but when I go to attach debugger I got following errors:
If I use remote debugging I got error "Connection refused";
If I use shared memory I got error similar to this text "dt_shmem:file path could not be found".
These errors occur when I start JBoss by running run.bat file. If I start JBoss from Netbeans IDE, I can attach to remote process (still have problem with shared memory approach), but then I have other problems, regarding variable primitives and model binding in page life cycle (I will not write about that now).
How can I solve these problems so I can debug application? At least, how can I find a better error message when it fails. I could not find too much on the Net by looking for "Connection refused" error only.
Why I cannot just press run main project(or web project) and that netbeans start application, open it in new browser tab(as localhost) and start debug mode? I'm coming from .net background and VS is offering this as out of the box tool (called ASP .NET development server). Why I have to use external web server and with every change deploy new application and then attach to it? Why Netbeans cannot by default use JVM for running application, and later when I deploy application I will choose which web server to use!?
I hope someone will make this clear to me :)
Thanks
added Note at 03.01.2013.
Well, when I changed VM options in project.properties file of web project (added run.args.extra=-J-Xms256m -J-Xmx756m), I succeeded to debug application and heat breakpoint when executing the code. However, I still have strange problem with Managed Bean properties. I have select list on page, and it is connected to Boolean property. When nothing is selected it should be set to null value by default (and it is when I start JBoss server by running run.bat file), but its value is by default set to false! I checked parameters post values in firebug and there is no problem in posting parameters to bean. It looks to me that problem is when JSF framework is trying to map post values to Managed Beans properties, but I cannot find out why this is happening. I also checked faces-config.xml, but did not find any specific rule for mapping to this specific property. Any tips?
I have built the war archieve for a struts application and deployed but sometimes it refuses to start. when i througly checked it, i found that tomcat refuses to start the application if there is no internet connection even though its just a hello world application with no web service being used. On closer examination I found that the error is thrown while parsing struts.xml file when there is no internet connection. Seems as though the DTD is being checked to parse it and in absence of internet connection its not possible to fetch DTD and auto extracting and starting of the war archieve file fails.
How can this problem be avoided so as to work with no internet connection. I use netbeans and am a novice.
Try downloading the DTD, putting it on your local host and pointing to the local DTD in your doctype declaration.