Common exceptions to developing Web projects using MyEclipse __web

Source: Internet
Author: User
Tags dateformat exception handling garbage collection sessions cncf

1,

Serious: Exception Starting filter Authority Java.lang.ClassNotFoundException:com.tju.cncf.interceptor.AuthorityFilter
At Org.apache.catalina.loader.WebappClassLoader.loadClass (webappclassloader.java:1678)
At Org.apache.catalina.loader.WebappClassLoader.loadClass (webappclassloader.java:1523)
At Org.apache.catalina.core.DefaultInstanceManager.loadClass (defaultinstancemanager.java:415)
At Org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged (defaultinstancemanager.java:397)
At Org.apache.catalina.core.DefaultInstanceManager.newInstance (defaultinstancemanager.java:118)
At Org.apache.catalina.core.ApplicationFilterConfig.getFilter (applicationfilterconfig.java:252)

Exception sending context initialized event to listener instance of class Org.springframework.web.context.ContextLoaderListener
Org.springframework.beans.factory.BeanDefinitionStoreException:IOException


Reason: The additional jar is not imported, and is re-import in Build path


2,
ERROR [Org.hibernate.util.JDBCExceptionReporter]-Cannot create poolableconnectionfactory (unable to open the database requested by login "CNCF". Login failed. )
2012-10-16 21:37:23,514 WARN [org.hibernate.cfg.SettingsFactory]-Could not obtain connection to query metadata
Org.apache.commons.dbcp.SQLNestedException:Cannot Create poolableconnectionfactory (unable to open the requested database "CNCF" for login). Login failed. )
At Org.apache.commons.dbcp.BasicDataSource.createDataSource (basicdatasource.java:1225)
At Org.apache.commons.dbcp.BasicDataSource.getConnection (basicdatasource.java:880)
At Org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection ( LOCALDATASOURCECONNECTIONPROVIDER.JAVA:81)
At Org.hibernate.cfg.SettingsFactory.buildSettings (settingsfactory.java:111)
At Org.hibernate.cfg.Configuration.buildSettingsInternal (configuration.java:2119)


Reason: in Applicationcontext.xml

<bean id= "DataSource" class= "Org.apache.commons.dbcp.BasicDataSource" >
<property name= "Driverclassname"
Value= "Com.microsoft.sqlserver.jdbc.SQLServerDriver" >
</property>
<property name= "url" value= "JDBC:SQLSERVER://192.168.1.109:1433;DATABASENAME=CNCF" ></property>
<property name= "username" value= "admin" ></property>
<property name= "password" value= "123" ></property>
</bean>


3,

WARN [Com.opensymphony.xwork2.ognl.OgnlValueStack]-Error setting expression ' user.department ' with value ' [ Ljava.lang.String @e10154 ' Ognl. Methodfailedexception:method "Setdepartment" failed for object com.tju.cncf.hibernate.userinfo@1bc339e [ Java.lang.NoSuchMethodException:com.tju.cncf.hibernate.UserInfo.setDepartment ([Ljava.lang.String;)]
Workaround:
The name in the JSP is consistent with the action class, such as User.department.departmentName


4,

Exception: Org.hibernate.LazyInitializationException:could not initialize proxy-no session
At Org.hibernate.proxy.AbstractLazyInitializer.initialize (abstractlazyinitializer.java:57)
At Org.hibernate.proxy.AbstractLazyInitializer.getImplementation (abstractlazyinitializer.java:111)

Reason: The default option for Hibernate3 many-to-one is lazy = "Proxy"
Workaround:<many-to-one> & <set> Set lazy= "false"

5,

Java.lang.NullPointerException Java.text.SimpleDateFormat.parse (simpledateformat.java:1235)
Java.text.DateFormat.parse (dateformat.java:335)

Reason: Some values are not passed in, empty
Workaround: Check the attributes in the action class and the corresponding in the JSP form

6,

Java.lang.NullPointerException Com.tju.cncf.action.user.UserAction.getInfo (useraction.java:159)
Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method)
Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:39)
Sun.reflect.DelegatingMethodAccessorImpl.invoke (DELEGATINGMETHODACCESSORIMPL.JAVA:25)
Java.lang.reflect.Method.invoke (method.java:597)
Reason: The incoming value is null
Workaround:


7,

Org.apache.jasper.JasperException:javax.servlet.ServletException:File "/jsp/user/jsp/common/header.jsp" not Found Org.apache.jasper.servlet.JspServletWrapper.handleJspException (jspservletwrapper.java:585)
Org.apache.jasper.servlet.JspServletWrapper.service (jspservletwrapper.java:455)
Org.apache.jasper.servlet.JspServlet.serviceJspFile (jspservlet.java:390)
Org.apache.jasper.servlet.JspServlet.service (jspservlet.java:334)
Javax.servlet.http.HttpServlet.service (httpservlet.java:722)
Reason: Wrong JSP path or no result in strust.xml corresponding to "string"
Workaround: Change relative path to absolute path/jsp/common/header.jsp

8,

Java.lang.RuntimeException:Invalid Action class configuration that references a unknown class named [Useraction] Org.apa Che.struts2.convention.ConventionsServiceImpl.determineResultPath (conventionsserviceimpl.java:100)
Org.apache.struts2.convention.ConventionUnknownHandler.determinePath (conventionunknownhandler.java:385)
Org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult (conventionunknownhandler.java:274)
Com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult (defaultunknownhandlermanager.java:87)
Reason: Result configuration error in Struts.xml, not found or not configured, check

9,

exception
Java.lang.NullPointerException
Com.tju.cncf.interceptor.AuthorityFilter.doFilter (authorityfilter.java:35)
Org.apache.struts2.dispatcher.FilterDispatcher.doFilter (filterdispatcher.java:389)
Reason: init () function parameter error in Authorityfilter


10, exception

Java.lang.NumberFormatException:For input string: "[Object Htmlinputelement]"
Java.lang.NumberFormatException.forInputString (numberformatexception.java:48)
Java.lang.Integer.parseInt (integer.java:447)
Java.lang.Integer.parseInt (integer.java:497)
Com.tju.cncf.action.user.UserAction.preModifyRole (useraction.java:364)
Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method)
Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:39)
Sun.reflect.DelegatingMethodAccessorImpl.invoke (DELEGATINGMETHODACCESSORIMPL.JAVA:25)
Java.lang.reflect.Method.invoke (method.java:597)

Reason:
Workaround:


11,

exception
Org.apache.jasper.JasperException:tag ' select ', field ' list ', name ' User.department.departmentName ': the requested The list key ' Alldepartments ' could is resolved as a collection/array/map/enumeration/iterator type. Example:people or people. {Name}-[Unknown location]
Org.apache.jasper.servlet.JspServletWrapper.handleJspException (jspservletwrapper.java:585)
Org.apache.jasper.servlet.JspServletWrapper.service (jspservletwrapper.java:470)
Org.apache.jasper.servlet.JspServlet.serviceJspFile (jspservlet.java:390)
Reason:
Workaround: <button class= "Longbuttton" type= "Submit" name= "Add"
onclick= "javascript:window.location.href= '/cncf/useraction_forwardto.action '" >

New users
</button>


12, Org.springframework.orm.hibernate3.hibernatesystemexception:a different object with the same identifier value is AL Ready associated with the session: [Com.tju.cncf.hibernate.privilege#1]; Nested exception is org.hibernate.nonuniqueobjectexception:a different object with the same identifier value was already Associated with the session: [Com.tju.cncf.hibernate.privilege#1]
Org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException ( sessionfactoryutils.java:679)
Org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException (Hibernateaccessor.java : 412)
Reason:
Workaround: You should localize the ID of this class, and change the value of generator to native in the. Hbm.xml of the class.


14,
Org.apache.catalina.session.ManagerBase IOException of exception handling
[ERROR] 16:08:58 org.apache.catalina.session.managerbase-ioexception while loading persisted sessions: Java.io.EOFException
......
......

This is because the session data that was saved on the hard disk failed to read, but it doesn't seem to matter, but if you don't, it will happen every time you start
Solve:
Simply delete the "Session.ser" file in the project under the Tomcat/work directory (d:/tomcat55/work/catalina/localhost/dbsstest).

15,

Unable to load configuration. -bean-jar:file:/d:/win7/apache-tomcat-6.0.26/webapps/doajax/web-inf/lib/struts2-spring-plugin-2.1.8.1.jar!/ struts-plugin.xml:29:132 resolves: The exception that is thrown by the Struts 2 version inconsistency.
Struts2-core-2.0.9.jar is inconsistent with the Struts2-spring-plugin-2.2.1.jar version.

16,
Background Indexer Crash Recovery
Java.lang.StackOverflowError
This question Baidu said is the building path of the JRE there is a problem, but I encountered the problem is not so,
Click Error log details are as follows:
Java.lang.StackOverflowError
At Java.util.ArrayList.get (arraylist.java:322)
At Org.eclipse.dltk.internal.javascript.typeinference.CombinedOrReference.isLocal (combinedorreference.java:296)
At Org.eclipse.dltk.internal.javascript.typeinference.TransparentRef.isLocal (typeinferencer.java:149)
At Org.eclipse.dltk.internal.javascript.typeinference.CombinedOrReference.isLocal (combinedorreference.java:297)
At
Solution:
1, Help > MyEclipse Configuration Center > Dashboard tab
2, under the Add-ons cancel check: "MyEclipse IE Javascript Debugger (Windows only)"
3, at the lower right of the hanging panel (Pending Changes) Selection: Apply 1 change
4, waiting for Eclipse to update itself, it may take a long time, the pro-test latency in more than half an hour ...

17,
Exception in Thread "defaultquartzscheduler_worker-4" Java.lang.OutOfMemoryError:PermGen
Exception in Thread "Defaultquartzscheduler_worker-1" Java.lang.OutOfMemoryError:PermGen
Exception in thread "Defaultquartzscheduler_quartzschedulerthread"
Workaround: MYECLIPSE--&GT;REFRENCE--&GT;TOMCAT--&GT;JDK Settings inside modify JVM startup MaxPermSize
First, Java.lang.OutOfMemoryError:PermGen space

PermGen space is the full name of the permanent Generation spaces, refers to the memory of the permanent storage area,
This memory is primarily stored in class and meta information by the JVM, and class is placed in PermGen space when it is loader.
Unlike the heap region where the class instance (Instance) is stored, the GC (garbage Collection) does not
PermGen space for cleaning, so if your application has a lot of class, it is likely to appear permgen space error,
This error is common when the Web server is pre compile the JSP. If your web app uses a lot of third-party jars, its size
This error message is generated if the JVM default size (4M) is exceeded.
Workaround: 1, manually set MaxPermSize size

Modify Tomcat_home/bin/catalina.sh
In the "echo" Using catalina_base: $CATALINA _base "", add the following line:
Java_opts= "-server-xx:permsize=64m-xx:maxpermsize=128m
Recommendation: Move the same third-party jar files to the Tomcat/shared/lib directory, which will reduce the memory consumption of the jar document.

2, enter the Tomcat WebApps folder to delete the unused works


18,
When IDENTITY_INSERT is set to OFF, the table cannot be


Failed to lazily initialize a collection of role:xxxxxx, no sessions or session is closed

Solution: 1, is the corresponding pair of more than two columns Lazy=true changed to Lazy=false can;
2, set lazy= "false" for set

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.