工作了一個(gè)多月,不管從工作行業(yè)還是工作性質(zhì),我都是一個(gè)新手,總結(jié)了一下工作中經(jīng)常遇到的問題,以方便查找參考,由于水平有限,也希望看到該文章的專業(yè)朋友給與指點(diǎn)。
java.lang.OutOfMemoryError: PermGen space
未解決不明白為什么,什么錯(cuò)誤導(dǎo)致的
javax.servlet.ServletException:
Request[/yhb] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text.
解決:form表單中缺少提交方法method=post/get
java.lang.ClassCastException: [Ljava.lang.Object;
at com.carry.service.impl.YhbManagerImpl.loginCheck(YhbManagerImpl.java:44)
javax.servlet.ServletException:
Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Cannot
open connection
java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference
解決辦法:內(nèi)存溢出,重新啟動(dòng)服務(wù)器
METHOD 傳參數(shù)方法找不到,ACTION中,方法的四個(gè)參數(shù)順序不能顛倒
tsList(ActionMapping mapping,ActionForm form,
HttpServletRequest request,
HttpServletResponse response)throws Exception
異常:不能連接數(shù)據(jù)庫(kù)(解決: 數(shù)據(jù)庫(kù)連接不上,連接異常,1,檢查網(wǎng)絡(luò)連接,2,檢查是否有連接驅(qū)動(dòng),)
Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory
(Io 異常: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=150999297)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))))
連接拒絕
[SettingsFactory] Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory
(Io 異常: The Network Adapter could not establish the connection)
網(wǎng)絡(luò)適配器不能建立連接,ORACLE數(shù)據(jù)庫(kù)服務(wù)器沒有打開
java.io.IOException: tmpFile.renameTo(classFile) failed
解決:JSP文件中有不能運(yùn)行的JAVA代碼!
Unable to find a value for "id" in object of class "java.lang.String" using operator "."
解決:<c:forEach var="fun" items="${listFun}"><c:forEach> 中的items="${listFun}" 錯(cuò)寫為items="listFun"
Illegal use of <when>-style tag without <choose> as its direct parent
"${map.yuanYouPur='yuanYouPur'}" contains invalid expression(s): javax.servlet.jsp.el.ELException: Encountered "=", expected
one of ["}", ".", ">", "gt", "<", "lt", "==", "eq", "<=", "le", ">=", "ge", "!=", "ne", "[", "+", "-", "*", "/", "div", "%",
"mod", "and", "&&", "or", "||", "?"]
解決:JSTL語(yǔ)言表達(dá)使用錯(cuò)誤!
The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value
cannot be converted to an integer.
解決:JSP頁(yè)面中,用‘ ${} ’輸出獲得的對(duì)象的屬性,使用錯(cuò)誤,例如返回LIST數(shù)組,其中存的對(duì)象是OBJ(頁(yè)面中可以定義變量obj代表一
個(gè)OBJ),取OBJ的屬性AGE,NAME, 應(yīng)該是${obj.age} ${obj.name}即可獲得OBJ的AGE和NAME屬性值,
檢查在使用${}的地方${obj.age} ${obj.name}是否正確,
異常
不能正常打開JSP文件?。?007.08.31) enough of enjoyment and comfort
Unable to create this part due to an internal error. Reason for the failure: Widget is disposed
org.eclipse.swt.SWTException: Widget is disposed
解決方法:
1 到window-preference-general-editors-file associations下看看你的*.html默認(rèn)打開方式是什么。
你改成myeclipse html editor就能打開了。
2 問題已經(jīng)解決,這應(yīng)該是MyEclipse5.0M2的一個(gè)bug,8月11號(hào)新發(fā)布的版本5.0.1GA已經(jīng)修復(fù)了此bug。
14:56:10,765 ERROR [DispatchAction] Dispatch[/proAdd] to method getOnePro returned an exception
java.lang.reflect.InvocationTargetException
Caused by: java.lang.Error: Unresolved compilation problem:
at com.carry.struts.action.ProAddAction.getOnePro(ProAddAction.java:60)
... 34 more
解決:查找API,解釋如下(本錯(cuò)誤是因?yàn)樵摲椒]有編譯)
InvocationTargetException 是一種包裝由調(diào)用方法或構(gòu)造方法所拋出異常的經(jīng)過(guò)檢查的異常。
從版本 1.4 開始,此異常已經(jīng)更新,符合通用異常鏈機(jī)制。“目標(biāo)異常”是在構(gòu)造的時(shí)候提供的,
可以通過(guò) getTargetException() 方法訪問,這類對(duì)象目前被認(rèn)為是導(dǎo)致異常的原因,
可以通過(guò) Throwable.getCause() 方法以及后面提到的“遺留方法”訪問它。
該異常問題同上!
09:11:22,156 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.actions.LocalStrings', returnNull=true
09:11:22,218 ERROR [DispatchAction] Dispatch[/login] to method tree returned an exception
java.lang.reflect.InvocationTargetException
Caused by: java.lang.Error: Unresolved compilation problem:
Syntax error on token "}", { expected
at com.carry.struts.action.LoginAction.tree(LoginAction.java:60)
... 35 more