The server encountered an internal error that prevented it from fulfilling this request exception

The OWASP Cheat Sheet Series was created to provide a concise collection of high value information on specific application security topics. - CheatSheetSeries/Error_Handling_Cheat_Sheet.md at maste...

Error Handling Cheat Sheet

Introduction

Error handling is a part of the overall security of an application. Except in movies, an attack always begins with a Reconnaissance phase in which the attacker will try to gather as much technical information (often name and version properties) as possible about the target, such as the application server, frameworks, libraries, etc.

Unhandled errors can assist an attacker in this initial phase, which is very important for the rest of the attack.

The following link provides a description of the different phases of an attack.

Context

Issues at the error handling level can reveal a lot of information about the target and can also be used to identify injection points in the target’s features.

Below is an example of the disclosure of a technology stack, here the Struts2 and Tomcat versions, via an exception rendered to the user:

HTTP Status 500 - For input string: "null"

type Exception report

message For input string: "null"

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.NumberFormatException: For input string: "null"
    java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    java.lang.Integer.parseInt(Integer.java:492)
    java.lang.Integer.parseInt(Integer.java:527)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:606)
    com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
    com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
    org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    ...

note: The full stack trace of the root cause is available in the Apache Tomcat/7.0.56 logs.

Below is an example of disclosure of a SQL query error, along with the site installation path, that can be used to identify an injection point:

Warning: odbc_fetch_array() expects parameter /1 to be resource, boolean given
in D:appindex_new.php on line 188

The OWASP Testing Guide provides different techniques to obtain technical information from an application.

Objective

The article shows how to configure a global error handler as part of your application’s runtime configuration. In some cases, it may be more efficient to define this error handler as part of your code. The outcome being that when an unexpected error occurs then a generic response is returned by the application but the error details are logged server side for investigation, and not returned to the user.

The following schema shows the target approach:

Overview

As most recent application topologies are API based, we assume in this article that the backend exposes only a REST API and does not contain any user interface content. The application should try and exhaustively cover all possible failure modes and use 5xx errors only to indicate responses to requests that it cannot fulfill, but not provide any content as part of the response that would reveal implementation details. For that, RFC 7807 — Problem Details for HTTP APIs defines a document format.
For the error logging operation itself, the logging cheat sheet should be used. This article focuses on the error handling part.

Proposition

For each technology stack, the following configuration options are proposed:

Standard Java Web Application

For this kind of application, a global error handler can be configured at the web.xml deployment descriptor level.

We propose here a configuration that can be used from Servlet specification version 2.5 and above.

With this configuration, any unexpected error will cause a redirection to the page error.jsp in which the error will be traced and a generic response will be returned.

Configuration of the redirection into the web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
...
    <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/error.jsp</location>
    </error-page>
...
</web-app>

Content of the error.jsp file:

<%@ page language="java" isErrorPage="true" contentType="application/json; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String errorMessage = exception.getMessage();
//Log the exception via the content of the implicit variable named "exception"
//...
//We build a generic response with a JSON format because we are in a REST API app context
//We also add an HTTP response header to indicate to the client app that the response is an error
response.setHeader("X-ERROR", "true");
//Note that we're using an internal server error response
//In some cases it may be prudent to return 4xx error codes, when we have misbehaving clients
response.setStatus(500);
%>
{"message":"An error occur, please retry"}

Java SpringMVC/SpringBoot web application

With SpringMVC or SpringBoot, you can define a global error handler by implementing the following class in your project. Spring Framework 6 introduced the problem details based on RFC 7807.

We indicate to the handler, via the annotation @ExceptionHandler, to act when any exception extending the class java.lang.Exception is thrown by the application. We also use the ProblemDetail class to create the response object.

import org.springframework.http.HttpStatus;
import org.springframework.http.ProblemDetail;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;

/**
 * Global error handler in charge of returning a generic response in case of unexpected error situation.
 */
@RestControllerAdvice
public class RestResponseEntityExceptionHandler extends ResponseEntityExceptionHandler {

    @ExceptionHandler(value = {Exception.class})
    public ProblemDetail handleGlobalError(RuntimeException exception, WebRequest request) {
        //Log the exception via the content of the parameter named "exception"
        //...
        //Note that we're using an internal server error response
        //In some cases it may be prudent to return 4xx error codes, if we have misbehaving clients
        //By specification, the content-type can be "application/problem+json" or "application/problem+xml"
        return ProblemDetail.forStatusAndDetail(HttpStatus.INTERNAL_SERVER_ERROR, "An error occur, please retry");
    }
}

References:

  • Exception handling with Spring
  • Exception handling with SpringBoot

ASP NET Core web application

With ASP.NET Core, you can define a global error handler by indicating that the exception handler is a dedicated API Controller.

Content of the API Controller dedicated to the error handling:

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Net;

namespace MyProject.Controllers
{
    /// <summary>
    /// API Controller used to intercept and handle all unexpected exception
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    [AllowAnonymous]
    public class ErrorController : ControllerBase
    {
        /// <summary>
        /// Action that will be invoked for any call to this Controller in order to handle the current error
        /// </summary>
        /// <returns>A generic error formatted as JSON because we are in a REST API app context</returns>
        [HttpGet]
        [HttpPost]
        [HttpHead]
        [HttpDelete]
        [HttpPut]
        [HttpOptions]
        [HttpPatch]
        public JsonResult Handle()
        {
            //Get the exception that has implied the call to this controller
            Exception exception = HttpContext.Features.Get<IExceptionHandlerFeature>()?.Error;
            //Log the exception via the content of the variable named "exception" if it is not NULL
            //...
            //We build a generic response with a JSON format because we are in a REST API app context
            //We also add an HTTP response header to indicate to the client app that the response
            //is an error
            var responseBody = new Dictionary<String, String>{ {
                "message", "An error occur, please retry"
            } };
            JsonResult response = new JsonResult(responseBody);
            //Note that we're using an internal server error response
            //In some cases it may be prudent to return 4xx error codes, if we have misbehaving clients
            response.StatusCode = (int)HttpStatusCode.InternalServerError;
            Request.HttpContext.Response.Headers.Remove("X-ERROR");
            Request.HttpContext.Response.Headers.Add("X-ERROR", "true");
            return response;
        }
    }
}

Definition in the application Startup.cs file of the mapping of the exception handler to the dedicated error handling API controller:

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace MyProject
{
    public class Startup
    {
...
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            //First we configure the error handler middleware!
            //We enable the global error handler in others environments than DEV
            //because debug page are useful during implementation
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                //Our global handler is defined on "/api/error" URL so we indicate to the
                //exception handler to call this API controller
                //on any unexpected exception raised by the application
                app.UseExceptionHandler("/api/error");

                //To customize the response content type and text, use the overload of
                //UseStatusCodePages that takes a content type and format string.
                app.UseStatusCodePages("text/plain", "Status code page, status code: {0}");
            }

            //We configure others middlewares, remember that the declaration order is important...
            app.UseMvc();
            //...
        }
    }
}

References:

  • Exception handling with ASP.Net Core

ASP NET Web API web application

With ASP.NET Web API (from the standard .NET framework and not from the .NET Core framework), you can define and register handlers in order to trace and handle any error that occurs in the application.

Definition of the handler for the tracing of the error details:

using System;
using System.Web.Http.ExceptionHandling;

namespace MyProject.Security
{
    /// <summary>
    /// Global logger used to trace any error that occurs at application wide level
    /// </summary>
    public class GlobalErrorLogger : ExceptionLogger
    {
        /// <summary>
        /// Method in charge of the management of the error from a tracing point of view
        /// </summary>
        /// <param name="context">Context containing the error details</param>
        public override void Log(ExceptionLoggerContext context)
        {
            //Get the exception
            Exception exception = context.Exception;
            //Log the exception via the content of the variable named "exception" if it is not NULL
            //...
        }
    }
}

Definition of the handler for the management of the error in order to return a generic response:

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.ExceptionHandling;

namespace MyProject.Security
{
    /// <summary>
    /// Global handler used to handle any error that occurs at application wide level
    /// </summary>
    public class GlobalErrorHandler : ExceptionHandler
    {
        /// <summary>
        /// Method in charge of handle the generic response send in case of error
        /// </summary>
        /// <param name="context">Error context</param>
        public override void Handle(ExceptionHandlerContext context)
        {
            context.Result = new GenericResult();
        }

        /// <summary>
        /// Class used to represent the generic response send
        /// </summary>
        private class GenericResult : IHttpActionResult
        {
            /// <summary>
            /// Method in charge of creating the generic response
            /// </summary>
            /// <param name="cancellationToken">Object to cancel the task</param>
            /// <returns>A task in charge of sending the generic response</returns>
            public Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
            {
                //We build a generic response with a JSON format because we are in a REST API app context
                //We also add an HTTP response header to indicate to the client app that the response
                //is an error
                var responseBody = new Dictionary<String, String>{ {
                    "message", "An error occur, please retry"
                } };
                // Note that we're using an internal server error response
                // In some cases it may be prudent to return 4xx error codes, if we have misbehaving clients 
                HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.InternalServerError);
                response.Headers.Add("X-ERROR", "true");
                response.Content = new StringContent(JsonConvert.SerializeObject(responseBody),
                                                     Encoding.UTF8, "application/json");
                return Task.FromResult(response);
            }
        }
    }
}

Registration of the both handlers in the application WebApiConfig.cs file:

using MyProject.Security;
using System.Web.Http;
using System.Web.Http.ExceptionHandling;

namespace MyProject
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            //Register global error logging and handling handlers in first
            config.Services.Replace(typeof(IExceptionLogger), new GlobalErrorLogger());
            config.Services.Replace(typeof(IExceptionHandler), new GlobalErrorHandler());
            //Rest of the configuration
            //...
        }
    }
}

Setting customErrors section to the Web.config file within the csharp <system.web> node as follows.

<configuration>
    ...
    <system.web>
        <customErrors mode="RemoteOnly"
                      defaultRedirect="~/ErrorPages/Oops.aspx" />
        ...
    </system.web>
</configuration>

References:

  • Exception handling with ASP.Net Web API

  • ASP.NET Error Handling

Sources of the prototype

The source code of all the sandbox projects created to find the right setup to use is stored in this GitHub repository.

Appendix HTTP Errors

A reference for HTTP errors can be found here RFC 2616. Using error messages that do not provide implementation details is important to avoid information leakage. In general, consider using 4xx error codes for requests that are due to an error on the part of the HTTP client (e.g. unauthorized access, request body too large) and use 5xx to indicate errors that are triggered on server side, due to an unforeseen bug. Ensure that applications are monitored for 5xx errors which are a good indication of the application failing for some sets of inputs.

Symptoms

When attempting to load Confluence in a browser after performing a new Install (or server migration, upgrade, etc), instead of loading the Confluence Setup Wizard a 500 error page is displayed

The following appears in the browser:

HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)
com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
com.atlassian.confluence.setup.ConfluenceEncodingFilter.getGlobalSettings(ConfluenceEncodingFilter.java:45)
com.atlassian.confluence.setup.ConfluenceEncodingFilter.getEncodingInternal(ConfluenceEncodingFilter.java:35)
com.atlassian.confluence.setup.ConfluenceEncodingFilter.getEncoding(ConfluenceEncodingFilter.java:27)
com.atlassian.core.filters.encoding.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:38)
com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44)
com.atlassian.confluence.servlet.FourOhFourErrorLoggingFilter.doFilter(FourOhFourErrorLoggingFilter.java:65)
root cause
java.lang.NullPointerException
com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:33)
com.atlassian.confluence.util.LazyComponentReference$Accessor.get(LazyComponentReference.java:46)
com.atlassian.util.concurrent.Lazy$Strong.create(Lazy.java:85)
com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:321)
com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)
com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
com.atlassian.confluence.setup.ConfluenceEncodingFilter.getGlobalSettings(ConfluenceEncodingFilter.java:45)
com.atlassian.confluence.setup.ConfluenceEncodingFilter.getEncodingInternal(ConfluenceEncodingFilter.java:35)
com.atlassian.confluence.setup.ConfluenceEncodingFilter.getEncoding(ConfluenceEncodingFilter.java:27)
com.atlassian.core.filters.encoding.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:38)
com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44)
com.atlassian.confluence.servlet.FourOhFourErrorLoggingFilter.doFilter(FourOhFourErrorLoggingFilter.java:65)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.35 logs.
Apache Tomcat/6.0.35

Cause

The permissions for the account that launches Confluence <confluence_home> and <confluence_install> were not set correctly. 

Resolution

  • The account that launches Confluence must be given Read/Write/Execute privileges for <confluence_home> and <confluence_install>

Last modified on Mar 30, 2016

Related content

  • No related content found

Problem

Previously working PMHUB (and CAFE) are no longer accessible.
When trying to access ..server:9510/pmhub/pm/admin, the below error is displayed.

Symptom

HTTP Status 500 — Servlet.init() for servlet equinoxbridgeservlet threw exception

type Exception report

message Servlet.init() for servlet equinoxbridgeservlet threw exception

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet equinoxbridgeservlet threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:662)

root cause

java.lang.RuntimeException: Error initializing storage.
org.eclipse.equinox.servletbridge.FrameworkLauncher.start(FrameworkLauncher.java:417)
org.eclipse.equinox.servletbridge.BridgeServlet.init(BridgeServlet.java:97)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:662)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.45 logs.

Cause

‘Corrupted’ cache; unknown specific (replicable) root cause.
Note. In this scenario, the server was rebooted over the weekend after some MS patches were installed.

Diagnosing The Problem

The issue was first encountered in CAFE. Ensuring that PMHUB is working, first, resulted in having to address PMHUB, which will most probably resolve the CAFE issue.

CAFE error: Expected value found [Invalid] = ,html. ,head.,title.Apache
Tomcat/6.0.45 — Error report ,/title.,style.,!—H1 {font-family:Tahoma,
Aria
at JSON.Parser.GetValue()
…………………..

Resolving The Problem

WARNING: The below steps will reset (delete) the pmhub admin configurations

1. Stop TM1 Application server
2. Delete/rename tm164tomcatworkcatalinalocalhostpmhub
3. Start TM1 Application Server
4. Access ..pmhub/pm/admin
5. Redo the pmhub configuration

Related Information

[{«Product»:{«code»:»SS9RXT»,»label»:»Cognos TM1″},»Business Unit»:{«code»:»BU053″,»label»:»Cloud & Data Platform»},»Component»:»TM1 Server»,»Platform»:[{«code»:»PF033″,»label»:»Windows»}],»Version»:»10.1.1;10.2;10.2.2″,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]

Contents

  • 1 Overview
  • 2 Prerequisites
  • 3 Symptoms
  • 4 Solution
    • 4.1 Version 4 bug, tomcat restart with Internal Database
    • 4.2 Tomcat Logs no allowing config.xml to upload
    • 4.3 Migration from v2 to v3/v4
    • 4.4 Transport deletion in Swivel 3.9.2

Overview

The HTTP Status 500 error can be seen when the Swivel Administration console encounters a problem and may be for a variety of reasons. This document is to help troubleshoot those issues.

Prerequisites

Swivel 3.x

Symptoms

The following error message may be seen in the browser, the message may vary according to the problem encountered.

HTTP Status 500 —

type Exception report

message

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.xmlbeans.impl.values.XmlValueDisconnectedException

org.apache.xmlbeans.impl.values.XmlObjectBase.check_orphaned(XmlObjectBase.java:1212)

com.swiveltechnologies.xmlconfig.impl.LookupImpl.isSetValue(Unknown Source)

com.swiveltechnologies.pinsafe.server.config.ConfigurationListImpl.getLookup(ConfigurationListImpl.java:470)

com.swiveltechnologies.pinsafe.server.ui.ConfigurationEditor.setListElement(ConfigurationEditor.java:647)

com.swiveltechnologies.pinsafe.server.ui.ConfigurationEditor.executePost(ConfigurationEditor.java:317)

com.swiveltechnologies.pinsafe.server.ui.InterfaceServlet.doPost(InterfaceServlet.java:265)

javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:125)

note The full stack trace of the root cause is available in the Apache Tomcat/x.x.x logs.
Apache Tomcat/x.x.x logs

Solution

A good place to start looking for such issues is in the Tomcat logs, see the Tomcat logs section under Troubleshooting_Files_FAQ

Confirm the config.xml file is showing a regular value. Also check the disk space Appliance_Disk_full

Known causes of this issue are given below:

Version 4 bug, tomcat restart with Internal Database

There is a known issue when restarting tomcat on version 4, up until 4.0.4.

As a workaround for this issue, log into the CMI, and set the database to shipping.

Log in with the default credential and on the Swivel Administration Portal, go to Database -> General and select the internal database again.

Now you should be back to normal, until a new tomcat restart.

One way to mitigate the problem, is to migrate the data from the internal database (old derby) to the appliance database.

On the Swivel Administration Portal, go to Database — General, with the Internal Database selected, open the Appliance Database details.

On the Driver entry box, write: org.mariadb.jdbc.Driver

On the URL entry box, write: jdbc:mariadb://localhost/pinsafe

Username and Password are both: pinsafe

Go to Migration -> Data , select the Appliance Database as targer and on the entry box, write: MIGRATE

Go back to Database — General and select the Appliance Database.

On the User Administration, you can check that all the users are there and the migration was a success.

Tomcat Logs no allowing config.xml to upload

If the config.xml is not disrupted but setting database to shipping doesn’t allow access to the admin portal we suggest creating a folder at /home/swivel/.swivel/logs and moving the log zip files to that folder. Restart tomcat and if you get access to the admin portal, set the database back to its type and go to Logging > XML and change the value to 257.
Also go back to the CMI and check that the logrotate.d has the notifemmty entry (check Appliance_Disk_full).

The error might show similar to the following:

Caused by: java.lang.ArrayIndexOutOfBoundsException: 8192

(…)

       at com.swiveltechnologies.pinsafe.server.logging.AbstractLogReader.readLogEntries(AbstractLogReader.java:29)
       at com.swiveltechnologies.pinsafe.server.logging.ZipLogFileReader.readLogFile(ZipLogFileReader.java:34) 	
       at com.swiveltechnologies.pinsafe.server.logging.ZipEntryLogFileInfo.load(ZipEntryLogFileInfo.java:77) 
       at com.swiveltechnologies.pinsafe.server.logging.AbstractLogLoader.getFirst(AbstractLogLoader.java:80)

Migration from v2 to v3/v4

The database naming for a v2 is pinsafe_rep which might imply at a migration level. It has been verified that sometimes the pinsafe_rep database must be created.

Entering the appliance via shipping mode, go to Database > General check if the settings are the correct ones. If missing just enter pinsafe_rep.

The error will be similar to the below error:

javax.servlet.ServletException: Servlet.init() for servlet dispatcher threw exception

       org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)

(…)

java.lang.NullPointerException

       com.swiveltechnologies.pinsafe.server.audit.AuditLogger.reloadConfiguration(AuditLogger.java:526)
       com.swiveltechnologies.pinsafe.server.logging.PINsafeLogManager.initialize(PINsafeLogManager.java:268)
       com.swiveltechnologies.pinsafe.server.config.Startup.startAllServices(Startup.java:151)
       com.swiveltechnologies.pinsafe.server.config.Startup.setServletContext(Startup.java:265)
       org.springframework.web.context.support.ServletContextAwareProcessor.postProcessBeforeInitialization(ServletContextAwareProcessor.java:75)

Transport deletion in Swivel 3.9.2

When a transport is deleted in Swivel 3.9.2 and a new one created an Error 500 message may be produced.

org.apache.xmlbeans.impl.values.XmlValueDisconnectedException
org.apache.xmlbeans.impl.values.XmlObjectBase.check_orphaned(XmlObjectBase.java:1212)
com.swiveltechnologies.xmlconfig.impl.LookupImpl.isSetValue(Unknown Source)
com.swiveltechnologies.pinsafe.server.config.ConfigurationListImpl.getLookup(ConfigurationListImpl.java:470)
com.swiveltechnologies.pinsafe.server.ui.ConfigurationEditor.setListElement(ConfigurationEditor.java:647)
com.swiveltechnologies.pinsafe.server.ui.ConfigurationEditor.executePost(ConfigurationEditor.java:317)
com.swiveltechnologies.pinsafe.server.ui.InterfaceServlet.doPost(InterfaceServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:125)

To overcome this issue the <path to Transient data>/conf/config.xml file can be edited, for an appliance this file is located in:

/home/swivel/.swivel/conf/config.xml

Backup the file before editing.

Stop Tomcat

Edit the file and look for the transport to be removed. Look for and remove <element readonly=»true»> to </element> inclusively

Example:

<element readonly=»true»>

<string name=»id» readonly=»true» maxlength=»32″>

<value>TRANSPORT NAME TO REMOVE</value>

</string>

<string name=»class» readonly=»true»>

<value>com.swiveltechnologies.pinsafe.server.transport.transport</value>

</string>

<long name=»stringcount»/>

<boolean name=»copytolalert»/>

<lookup name=»alertgroup» lookup=»groups» blank=»repository_groups_no_group»/>

<lookup name=»group» lookup=»groups» blank=»repository_groups_no_group»/>

<lookup name=»attribute» lookup=»attributes» blank=»repository_attributes_none»>

<value>phone</value>

</lookup>

</element>

Also look for the following

<group name=»TRANSPORT NAME TO REMOVE» generated=»true»> to </group> inclusively

Save the file

Start Tomcat

Test

Hello All,
I am new to jsp and struts. I am tryign to build a simple apllication and later build on it as I learn. I am using netbeans and tomcat 6. I keep getting the error: The server encountered an internal error () that prevented it from fulfilling this request and the root cause being java.lang.StackOverflowError
everytime I try to submit a form. Below is the jsp I’m trying to submit and the struts form and action classes I have.
Also these are the first few lines of the log:
Mar 11, 2008 9:38:26 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet action threw exception
java.lang.StackOverflowError
at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:545)

Can you please direct me in which way to go.

JSP:
<%@ taglib uri=»/WEB-INF/struts-bean.tld» prefix=»bean» %>
<%@ taglib uri=»/WEB-INF/struts-html.tld» prefix=»html» %>
<%@ taglib uri=»/WEB-INF/struts-logic.tld» prefix=»logic» %>
<%@ taglib uri=»/WEB-INF/struts-tiles.tld» prefix=»tiles» %>

<html:form action=»login.do»>
<table>
<tr>
<td>Username:&nbsp;</td>
<td><html:text property=»username» size=»20″ /></td>
<td><html:errors property=»username»/></td>
</tr>
<tr>
<td>Password:&nbsp;</td>
<td><html:text property=»password» size=»20″ /></td>
<td><html:errors property=»password»/></td>
</tr>
<tr>
<html:submit value=»Submit»/>

</tr>
</table>
</html:form>

ActionForm:
package com.myapp.struts.Form;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMessage;

/**
*
* @author FAkoNai
*/
public class LoginForm extends ActionForm
{
private String username = «»;
private String password = «»;

public ActionErrors validate()
{
ActionErrors errors = new ActionErrors();
if (username.isEmpty() || username == null)
errors.add(username, new ActionMessage(«PLease enter a username»));
if (password.isEmpty() || password == null)
errors.add(password, new ActionMessage(«Please enter a password»));

return errors;
}

public String getPassword() {
return password;
}

public void setPassword(String aPassword) {
password = aPassword;
}

public String getUsername() {
return username;
}

public void setUsername(String aUsername) {
username = aUsername;
}
}

Action:
package com.myapp.struts.Action;

import com.myapp.struts.Form.LoginForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.MappingDispatchAction;

/**
*
* @author FAkoNai
*/
public class LoginAction extends MappingDispatchAction
{
private final static String SUCCESS = «success»;

public ActionForward signin(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)

{
LoginForm lform = (LoginForm)form;
ActionErrors errors = lform.validate();
if (errors != null)
return mapping.findForward(«failure»);
else
return mapping.findForward(«success»);
}
}

struts-config:
<action
path=»/login»
input=»/welcome.jsp»
parameter=»signin»
type=»com.myapp.struts.Action.LoginAction»
name=»loginForm»
scope=»request»
validate=»false»>
<forward
name=»failure» path=»/login.do»/>
<forward
name=»success» path=»/loginSuccess.do»/>
</action>

Edited by: majorgh on Mar 11, 2008 9:00 AM

Понравилась статья? Поделить с друзьями:
  • The server encountered an internal error or misconfiguration and was unable to complete your request
  • The server encountered an internal error and was unable to complete your request перевод
  • The server encountered an internal error and was unable to complete your request nextcloud
  • The server encountered an error processing the request see server logs for more details
  • The server encountered a temporary error and could not complete your request перевод