500: Unexpected server error

CPAS Forum (Inactive)
500: Unexpected server error vensel  2006-01-11 15:55
Status: Closed
 
I am trying to do an express install on Windows xp and received the following error



500: Unexpected server error
java.lang.reflect.InvocationTargetException


[Show more details]
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
       at org.fhcrc.cpas.util.BoundMap.get(BoundMap.java:89)
       at org.fhcrc.cpas.view.GroovyView.createModelBinding(GroovyView.java:475)
       at org.fhcrc.cpas.view.GroovyView.renderView(GroovyView.java:447)
       at org.fhcrc.cpas.view.WebPartView.render(WebPartView.java:123)
       at org.fhcrc.cpas.view.HttpView._render(HttpView.java:197)
       at org.fhcrc.cpas.view.HttpView.include(HttpView.java:403)
       at org.fhcrc.cpas.view.ViewController.includeView(ViewController.java:47)
       at admin.AdminController.startupFailure(AdminController.java:589)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:820)
       at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:750)
       at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:425)
       at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:282)
       at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:306)
       at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:48)
       at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
       at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:109)
       at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:1979)
       at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.continueChain(ActionInterceptors.java:63)
       at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:86)
       at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2048)
       at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
       at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:592)
       at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:856)
       at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:600)
       at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:163)
       at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
       at org.fhcrc.cpas.view.ViewServlet.service(ViewServlet.java:90)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.fhcrc.cpas.data.TransactionFilter.doFilter(TransactionFilter.java:36)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:123)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.fhcrc.cpas.security.AuthFilter.doFilter(AuthFilter.java:53)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.fhcrc.cpas.module.ModuleLoader.doFilter(ModuleLoader.java:228)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
       at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.fhcrc.cpas.util.BoundMap.get(BoundMap.java:80)
       ... 65 more
Caused by: java.lang.NullPointerException
       at org.fhcrc.cpas.data.CoreSchema.getTableInfoContainers(CoreSchema.java:53)
       at org.fhcrc.cpas.data.ContainerManager.getForPath(ContainerManager.java:235)
       at org.fhcrc.cpas.view.ViewContext.getContainer(ViewContext.java:235)
       at org.fhcrc.cpas.view.ViewContext.getACL(ViewContext.java:154)
       ... 70 more


request attributes
javax.servlet.forward.request_uri = /cpas/admin/startupFailure.do
javax.servlet.forward.context_path = /cpas
javax.servlet.forward.servlet_path = /admin/startupFailure.do
_netui:_actionURI = /cpas/admin/startupFailure.do
org.apache.struts.action.ERROR = org.apache.struts.action.ActionMessages@ef4599
org.apache.struts.action.EXCEPTION = java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
sharedFlow = {}
url_rewriters = [org.apache.beehive.netui.pageflow.internal.DefaultURLRewriter@0]
globalApp = global.Global@c278b5
pageInput = {}
_defaultValidationMessages = org.apache.beehive.netui.pageflow.internal.ExpressionAwareMessageResources@182c2d9
org.apache.struts.action.mapping.instance = ActionConfig[path=/startupFailure,parameter=admin.AdminController,scope=request,type=org.apache.beehive.netui.pageflow.internal.FlowControllerAction
bundle = {_defaultValidationMessages=StrutsBundleNode messageResource: org.apache.struts.util.PropertyMessageResources@1af8502 locale: en_US}
pageFlow = admin.AdminController@1c66ec7
org.apache.beehive.controls.runtime.servlet.ServletBeanContext = org.apache.beehive.netui.pageflow.internal.PageFlowBeanContext@92eb86
_netui:servletContext = org.apache.catalina.core.ApplicationContextFacade@18facfb
org.apache.struts.action.MODULE = org.apache.struts.config.impl.ModuleConfigImpl@143073a
 
 
arauch responded:  2006-01-11 16:05
Look at your cpas.log file in the /tomcat/logs directory. The first exception in the log should be the root cause of this error. The root cause should provide a much more useful message (e.g., "Can't connect to database server", "Incorrect login").

If the answer is not obvious from looking at the log then please post your log and your cpas.xml files here.

BTW, the next release of CPAS should provide more information about the root cause on this initial web page.

 
vensel responded:  2006-01-11 16:28
Thanks,

Here is the first error from the log:

Jan 2006 15:46:20,437 DEBUG CoreModule : Connection to cpasDataSource at jdbc:postgresql://localhost/cpas failed with the following error:

11 Jan 2006 15:46:20,437 DEBUG CoreModule : Message: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. SQLState: 08004 ErrorCode: 0

Okay how to I go back and correct this misconfiguration?

Thanks,

Bill

 
jgrundstad responded:  2006-01-12 06:53
I don't mean to hijack the thread, but I'm getting a different error from the log for the same 500: Unexpected server error java.lang.reflect.InvocationTargetException

I'm getting this from the cpas.log:

12 Jan 2006 08:15:47,551 ERROR Global : Unhandled exception caught in Global.app: 500: Unexpected server error java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

 
arauch responded:  2006-01-12 06:55
Responding to vensel@pw.usda.gov:

There may be more clues in the full log file and your cpas.xml, but from what you've posted I would suspect one of the following:

  • The PostgreSQL service is not running
  • The port is incorrect. If not specified in the URL, the connection is attempted on 5432; is PostgreSQL listening on something other than 5432? The postgresql.conf file should contain the port number the service will use (e.g., port = 5432).
  • You have a firewall installed that is preventing access to the PostgreSQL port
You can confirm that this is a basic JDBC connection problem (as opposed to anything specific to CPAS) using the PGTest command line tool posted here: https://cpas.fhcrc.org/announcements/home/support/thread.view?rowId=50

You can use PGTest to try different database connection parameters, then transfer that configuration to cpas.xml for CPAS to use.

 
arauch responded:  2006-01-12 06:59
Responding to jgrundstad@eng.uiowa.edu:

Please post your full log and your cpas.xml (clearing out any passwords or other sensitive information first).

 
jgrundstad responded:  2006-01-12 07:17
Great, thanks in advance for the help...


<Context path="/cpas" docBase="/home/jgrundst/CPAS/cpaswebapp" debug="1"

reloadable="true" crossContext="true">

<Logger className="org.apache.catalina.logger.FileLogger"

prefix="localhost_cpas_log." suffix=".txt"

timestamp="true"/>

<!-- DBSchemas -->

<Environment name="dbschema/comm" value="jdbc/cpasDataSource,cpas,comm" type="java.lang.String"/>

<Environment name="dbschema/core" value="jdbc/cpasDataSource,cpas,core" type="java.lang.String"/>

<Environment name="dbschema/exp" value="jdbc/cpasDataSource,cpas,exp" type="java.lang.String"/>

<Environment name="dbschema/flow" value="jdbc/cpasDataSource,cpas,flow" type="java.lang.String"/>

<Environment name="dbschema/issues" value="jdbc/cpasDataSource,cpas,issues" type="java.lang.String"/>

<Environment name="dbschema/ms2" value="jdbc/cpasDataSource,cpas,ms2" type="java.lang.String"/>

<Environment name="dbschema/pipeline" value="jdbc/cpasDataSource,cpas,pipeline" type="java.lang.String"/>

<Environment name="dbschema/portal" value="jdbc/cpasDataSource,cpas,portal" type="java.lang.String"/>

<Environment name="dbschema/prop" value="jdbc/cpasDataSource,cpas,prop" type="java.lang.String"/>

<Environment name="dbschema/prot" value="jdbc/cpasDataSource,cpas,prot" type="java.lang.String"/>

<Environment name="dbschema/test" value="jdbc/cpasDataSource,cpas,test" type="java.lang.String"/>

<Resource name="jdbc/cpasDataSource" auth="Container"

type="javax.sql.DataSource"

username="postgres"

password="xxxx"

driverClassName="org.postgresql.Driver"

url="jdbc:postgresql://localhost/cpas"

maxActive="20"

maxIdle="10"/>

<Resource name="mail/Session" auth="Container"

type="javax.mail.Session"

mail.smtp.host="xxxxxx"

mail.smtp.user="xxxxxx"

mail.smtp.port="25"

mail.from="xxxxxxx"/>

<!--

<Resource name="drive/@@networkDriveLetter@@" auth="Container"

type="org.fhcrc.cpas.util.NetworkDrive"

factory="org.apache.naming.factory.BeanFactory"

path="@@networkDrivePath@@"

user="@@networkDriveUser@@"

password="@@networkDrivePassword@@"/>

-->

</Context>


Thanks again, Jason

 
jgrundstad responded:  2006-01-12 08:00
I apologize, I just realized that my situation is even more different than the original poster. I am doing a manual install on a linux system (for what it's worth). Let me know if there is any other info I can provide. Thanks, Jason
 
arauch responded:  2006-01-12 10:12
The root cause, i.e., the very first error in your log, is this:

java.lang.NoClassDefFoundError: org/apache/tomcat/dbcp/dbcp/BasicDataSource

It looks to me like your Tomcat installation doesn't have database connection pooling configured. On my install it's provided by /tomcat5/common/lib/naming-factory-dbcp.jar.

 
vensel responded:  2006-01-12 11:49
I had done the install using the Windows CPSA Installer. I see now that postgresql service is not started and does not seem to be installed on my system. There is a folder "3rdparty" that contains postgresql-8.0-int.msi in it. However when I double click on that file I get the message "Please use the main MSI file to install PostgreSQL.

Thanks,

Bill

 
mbellew responded:  2006-01-12 12:51
I don't know why it failed to install, but on the chance it is a system issue...

Are you using Windows XP or Windows Server? Did you install from the console or through Remote Desktop? Are you an Administrator on the machine?

You can download the Postgres MSI's directly from

http://www.postgresql.org/ftp/source/v8.0.6/

To see if you can successfully install that (please don't use 8.1 until CPAS 1.2).

 
mbellew responded:  2006-01-12 12:52
Sorry, wrong link. That should have been

http://www.postgresql.org/ftp/binary/v8.0.6/win32/

 
vensel responded:  2006-01-12 13:10
I am an administrator on the system. I am running Windows XP Professional. I am not certain what you mean console or remote Desktop. I did not instal from the c:> prompt if that is what you mean but rather I was using the graphical user interface. I was not using Remote Desktop.

Where exactly should I install the Postgres to? I ddid download the Win32 MSI version of 8.0.6.

Thanks Bill

 
vensel responded:  2006-01-12 13:48
Okay, I downloaded and installed Postgresql 8.0.6 and it is now running as a service. However I am still not able to connect. The CPAS log file shows:

12 Jan 2006 12:14:41,984 ERROR DbSchema : Exception loading schema from metadatacore org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.) So at this point I am going to try to check host name and port. But how do I check that the "postmaster" is accepting connections?

Thanks

Bill

 
mbellew responded:  2006-01-12 13:54
The unfortunate problem is that it is possible for the Postgres install to fail without our master install script 'knowing' it failed. So the question is what went wrong, I'm hoping by running the install by hand we can figure that out.

It doesn't matter where postgres is installed. You just need copy whatever user/password you choose when you install into cpas.xml.

If the postgres install works, it leaves us wondering where things when wrong in our default install (fortunately we haven't seen this very often).

 
vensel responded:  2006-01-12 14:39
Hello, I have tried to run the PGTest.cmd and it returns the error that:

The system cannot find the path specified. The same error is returned when I run either Specify parameters individually:   Usage: PGTest {server} {port} {database} {username} {password}   Example: PGTest localhost 5432 cpas postgres sasa

or

Specify full PostgreSQL connection URL:   Usage: PGTest {connection string} {username} {password}   Example: PGTest jdbc:postgresql://localhost:5432/cpas postgres sasa

Thanks,

Bill

 
mbellew responded:  2006-01-12 14:48
The PGTest.cmd uses %JAVA_HOME% environment variable, so make sure that is set to point to your java directory.
 
mbellew responded:  2006-01-12 14:57
Note: that you need a JDK installed (which has the javac program). You can comment out the first line of the script to see what the script is doing, and where it is failing.
 
vensel responded:  2006-01-13 09:53
I have javac.exe and java.exe in C:CPASInstalljdk1.5.0_04bin.

I added C:CPASInstalljdk1.5.0_04bin to my path statement in enviromental variables and then rebooted the syste. After commenting out the first line with <! and run PGtest from the c:> the following is generated:

The system cannot find the file specified. The system cannot find the file specified. The system cannot find the path specified. The system cannot find the path specified.

C:>

Thanks,

Bill

 
vensel responded:  2006-01-13 10:21
Okay, I just tried to enter the CPAS system and it startedup and let me log in despite the fact that the PGtest.cmd script still fails! So now I am going to try to install the different modules.

Thanks

Bill

 
mbellew responded:  2006-01-13 10:50
Thanks for sticking with it.

PS: For the next drop, we'll fix PGTest to work even if JAVA_HOME is not set.

 
greener responded:  2006-02-03 14:12
Hey everyone, I installed CPAS about a month ago (XP pro, CPAS Installer, not manually) and it was working great until today when all I did was I reboot the machine and then when I tried to connect to cpas I recieved:

500: Unexpected server error java.lang.reflect.InvocationTargetException

Show more details java.lang.RuntimeException: java.lang.reflect.InvocationTargetException       at org.fhcrc.cpas.util.BoundMap.get(BoundMap.java:89)       at org.fhcrc.cpas.view.GroovyView.createModelBinding(GroovyView.java:475)       at org.fhcrc.cpas.view.GroovyView.renderView(GroovyView.java:447)       at org.fhcrc.cpas.view.WebPartView.render(WebPartView.java:123)       at org.fhcrc.cpas.view.HttpView._render(HttpView.java:197)       at org.fhcrc.cpas.view.HttpView.include(HttpView.java:403)       at org.fhcrc.cpas.view.ViewController.includeView

And it continues...

I read through all the posts pertaining to this problem.

It appears that the user listed above vensel@pw.usda.gov

had the same exact problems and me. I tried to use PGTEST and also recieved:

The system cannot find the file specified

I went in and added the environmental variable:

Variable name %JAVA_HOME% (and I tried just JAVA_HOME) Variable Value: C:CPASInstalljdk1.5.0_04bin

to both the user and system, however I'm still getting the same 500 error I attached my log and cpas file for review. There is no firewall currently on and since the system has been working for a month so I can assume the Postgre works The post gre conf file looks like the 5432 port has not changed. Any advice folks can give me is muchly appreciated.

thanks

-Rich

 
adam responded:  2006-12-04 22:07