简体   繁体   中英

error when deployed application in apache tomcat

i have deployed my application on apache tomcat. before that, one of my controller class name has been changed.

Before lk_Controller After LKController

but apache cant read the class (apply) on ZK framework. note:controlled class has been packaged in one package.

here's my ZK file:

<!-- Content ommited above -->
 <window title="laporan Keuangan" width="auto" height="auto" border="" apply="controller.lap_keuangan.LKController">
                                     <listbox id="listlk">
                                         <listhead>
                                            <listheader label="tanggal"/>
                                            <listheader label="debit"/>
                                            <listheader label="kredit"/>
                                            <listheader label="total"/>
                                         </listhead>

                                     </listbox>
                                 </window>

and the error list on apache log is:

Caused by: java.lang.ClassNotFoundException: controller.lk_Controller
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at org.zkoss.lang.Classes.forNameByThread(Classes.java:271)
    at org.zkoss.zk.ui.impl.PageImpl.resolveClass(PageImpl.java:425)
    at org.zkoss.zk.ui.metainfo.ComponentInfo.toComposer(ComponentInfo.java:405)
    at org.zkoss.zk.ui.metainfo.ComponentInfo.toComposer(ComponentInfo.java:397)
    at org.zkoss.zk.ui.metainfo.ComponentInfo.toComposers(ComponentInfo.java:365)
    at org.zkoss.zk.ui.metainfo.ComponentInfo.resolveComposer(ComponentInfo.java:352)
    ... 52 more

i have undeployed the application before running it again. this is waste my time to tracking error log with specified message.

In default case, when you change a class name ,

you have to restart your server for updating the classpath.

For editing zul , you don't have to restart the server .

As what I got from your question , you mentioned your zul is modified , but in your given result , it's not running under a modified zul.

There are some possibility , 1.the resource is not updated as your expect, if you are running under Eclipse WTP, sometimes the WTP have the bug for not cleaning/redeploy the resource correctly/slowly.

It's very easy to verify this , go to the webapp folder and see if the zul is changed or not.

2.the file is cached by some cache framework. (By default it's not cached , but I have seen some project use their own cache tool cause this issue.)

I think it should be a environment issue and not a ZK issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM