PDA

View Full Version : com.caucho.quercus.QuercusException: can't redefine function trimarray


jgardner16
10-14-2009, 07:33 PM
Hi I am getting com.caucho.quercus.QuercusException: can't redefine function trimarray in one environment but everything is fine in another environment. Any ideas what could be the problem? PHP version is the same seems like everything from phpinfo is the same but I cant get past this error. Any ideas would be greatly appreciated.

nam
10-14-2009, 10:53 PM
What version are you using?

This error is caused by your php script defining user function trimarray() more than once. This may be unintentional due to a php.ini setting or a Quercus bug that is causing your script to doubly-include a file.

possible php.ini causes:
auto_prepend_file
auto_append_file

jgardner16
10-15-2009, 04:46 PM
Hi I am using version 3.1.6. Can you tell me what the PHP.ini setting should be?

jgardner16
10-15-2009, 05:00 PM
Also this function is in a class file and it works fine in one environment but not in another

nam
10-15-2009, 05:38 PM
You should be using 4.0.1. It's available at http://quercus.caucho.com

The default ini values shouldn't give you any problems.

Can you add debugging code to that page? It's a good idea to get thread dumps (with resin_thread_dump() or debug_backtrace()).

jgardner16
10-15-2009, 06:25 PM
ok so I am using the default php.ini file and I upgraded to 4.01. I m still getting the same error message on one server everything fine on another server. Any other ideas seems like there is some kind of server setting problem.

nam
10-15-2009, 06:29 PM
For the page that contains the trimarray() function, can you add to the very top of that page:

resin_thread_dump();

and send the output? This is assuming you're using Resin.

jgardner16
10-15-2009, 06:33 PM
I am running this on JBOSS actually I have a stack trace

009-10-15 11:32:40,556 ERROR [org.apache.catalina.core.ContainerBase] Servlet.service() for servlet Quercus Servlet threw exception
com.caucho.quercus.QuercusException: can't redefine function getfilelist
at com.caucho.quercus.env.Env.addFunction(Env.java:32 80)
at com.caucho.quercus.program.QuercusProgram.importDe finitions(QuercusProgram.java:460)
at com.caucho.quercus.page.InterpretedPage.importDefi nitions(InterpretedPage.java:126)
at com.caucho.quercus.env.Env.pageInit(Env.java:468)
at com.caucho.quercus.env.Env.include(Env.java:4875)
at com.caucho.quercus.env.Env.includeOnce(Env.java:48 33)
at com.caucho.quercus.expr.IncludeOnceExpr.eval(Inclu deOnceExpr.java:89)
at com.caucho.quercus.statement.ExprStatement.execute (ExprStatement.java:64)
at com.caucho.quercus.statement.BlockStatement.execut e(BlockStatement.java:105)
at com.caucho.quercus.program.QuercusProgram.execute( QuercusProgram.java:400)
at com.caucho.quercus.page.InterpretedPage.execute(In terpretedPage.java:89)
at com.caucho.quercus.env.Env.executePage(Env.java:34 47)
at com.caucho.quercus.env.Env.include(Env.java:4880)
at com.caucho.quercus.env.Env.includeOnce(Env.java:48 33)
at com.caucho.quercus.expr.IncludeOnceExpr.eval(Inclu deOnceExpr.java:89)
at com.caucho.quercus.statement.ExprStatement.execute (ExprStatement.java:64)
at com.caucho.quercus.statement.BlockStatement.execut e(BlockStatement.java:105)
at com.caucho.quercus.program.QuercusProgram.execute( QuercusProgram.java:400)
at com.caucho.quercus.page.InterpretedPage.execute(In terpretedPage.java:89)
at com.caucho.quercus.env.Env.executePage(Env.java:34 47)
at com.caucho.quercus.env.Env.include(Env.java:4880)
at com.caucho.quercus.env.Env.includeOnce(Env.java:48 33)
at com.caucho.quercus.expr.IncludeOnceExpr.eval(Inclu deOnceExpr.java:89)
at com.caucho.quercus.statement.ExprStatement.execute (ExprStatement.java:64)
at com.caucho.quercus.program.Function.callImpl(Funct ion.java:381)
at com.caucho.quercus.program.Function.call(Function. java:310)
at com.caucho.quercus.function.AbstractFunction.call( AbstractFunction.java:426)
at com.caucho.quercus.env.Env.findClassExt(Env.java:4 282)
at com.caucho.quercus.env.Env.findClass(Env.java:4239 )
at com.caucho.quercus.env.Env.findClass(Env.java:4216 )
at com.caucho.quercus.env.Env.findAbstractClass(Env.j ava:4584)
at com.caucho.quercus.expr.NewExpr.eval(NewExpr.java: 93)
at com.caucho.quercus.expr.Expr.evalCopy(Expr.java:40 5)
at com.caucho.quercus.expr.AssignExpr.eval(AssignExpr .java:86)
at com.caucho.quercus.statement.ExprStatement.execute (ExprStatement.java:64)
at com.caucho.quercus.statement.BlockStatement.execut e(BlockStatement.java:105)
at com.caucho.quercus.program.QuercusProgram.execute( QuercusProgram.java:400)
at com.caucho.quercus.page.InterpretedPage.execute(In terpretedPage.java:89)
at com.caucho.quercus.env.Env.executePage(Env.java:34 47)
at com.caucho.quercus.env.Env.include(Env.java:4880)
at com.caucho.quercus.env.Env.includeOnce(Env.java:48 33)
at com.caucho.quercus.expr.IncludeOnceExpr.eval(Inclu deOnceExpr.java:89)
at com.caucho.quercus.statement.ExprStatement.execute (ExprStatement.java:64)
at com.caucho.quercus.statement.BlockStatement.execut e(BlockStatement.java:105)
at com.caucho.quercus.program.QuercusProgram.execute( QuercusProgram.java:400)
at com.caucho.quercus.page.InterpretedPage.execute(In terpretedPage.java:89)
at com.caucho.quercus.env.Env.executePageTop(Env.java :3458)
at com.caucho.quercus.env.Env.executeTop(Env.java:340 4)
at com.caucho.quercus.servlet.QuercusServletImpl.serv ice(QuercusServletImpl.java:181)
at com.caucho.quercus.servlet.QuercusServlet.service( QuercusServlet.java:578)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :359)
at org.springframework.security.intercept.web.FilterS ecurityInterceptor.invoke(FilterSecurityIntercepto r.java:109)
at org.springframework.security.intercept.web.FilterS ecurityInterceptor.doFilter(FilterSecurityIntercep tor.java:83)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
at org.springframework.security.ui.SessionFixationPro tectionFilter.doFilterHttp(SessionFixationProtecti onFilter.java:67)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
at org.springframework.security.ui.ExceptionTranslati onFilter.doFilterHttp(ExceptionTranslationFilter.j ava:101)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
at org.springframework.security.providers.anonymous.A nonymousProcessingFilter.doFilterHttp(AnonymousPro cessingFilter.java:105)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
at org.springframework.security.ui.rememberme.Remembe rMeProcessingFilter.doFilterHttp(RememberMeProcess ingFilter.java:116)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
at org.springframework.security.wrapper.SecurityConte xtHolderAwareRequestFilter.doFilterHttp(SecurityCo ntextHolderAwareRequestFilter.java:91)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
at org.springframework.security.ui.basicauth.BasicPro cessingFilter.doFilterHttp(BasicProcessingFilter.j ava:173)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
at org.springframework.security.ui.AbstractProcessing Filter.doFilterHttp(AbstractProcessingFilter.java: 271)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
at org.springframework.security.ui.logout.LogoutFilte r.doFilterHttp(LogoutFilter.java:89)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
at org.springframework.security.context.HttpSessionCo ntextIntegrationFilter.doFilterHttp(HttpSessionCon textIntegrationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
at org.springframework.security.util.FilterChainProxy .doFilter(FilterChainProxy.java:174)
at org.springframework.web.filter.DelegatingFilterPro xy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterPro xy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

nam
10-15-2009, 07:26 PM
Is the working system exactly the same as the one that's having problems? OS? Application server version? Java?

We maintain a list of already included files and we may not be covering a case where the included file's path is slightly different from when it was included earlier. We have extensive testing for this on Resin, but not so much for Tomcat, JBoss, etc.

jgardner16
10-15-2009, 10:06 PM
There are just minor differences for example

working:
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02, mixed mode)


not working:
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)

jboss is the save version

Both are Lynix one 64 bit AMD the other 32bit Intel

jgardner16
10-15-2009, 10:09 PM
phpinfo

not working:
PHP Version => 5.2.0
System => Linux 2.6.18-128.1.10.el5 i386
Build Date => 20090801
Configure Command => n/a
Server API => CGI
Virtual Directory Support => disabled
Configuration File (php.ini) Path => WEB-INF/php.ini
PHP API => 20031224
PHP Extension => 20041030
Debug Build => no
Thread Safety => enabled
Registered PHP Streams => php, file, http, https

Working:
PHP Version => 5.2.0
System => Linux 2.6.18-128.1.10.el5xen amd64
Build Date => 20070628T2777
Configure Command => n/a
Server API => CGI
Virtual Directory Support => disabled
Configuration File (php.ini) Path => WEB-INF/php.ini
PHP API => 20031224
PHP Extension => 20041030
Debug Build => no
Thread Safety => enabled
Registered PHP Streams => php, file, http, https

nam
10-15-2009, 10:18 PM
It appears that you are using different versions of Quercus. Can you double-check the exact Quercus version? The non-working version appears to be 4.0.1.

jgardner16
10-15-2009, 11:35 PM
yes that is right the non working version was upgraded to try to fix but get the same error in version 3.1.6 and 4.0.1

jgardner16
10-16-2009, 12:08 AM
so straing have deployed to tomcat 5.5 now and I am getting same problem. There must be some environment type thing that is causing this. Any ideas?

nam
10-16-2009, 09:04 PM
If possible, can you send me your php application as a zip file?