[Java] ERROR reading java.io.ByteArrayInputStream

Pagina: 1
Acties:

  • ari3
  • Registratie: Augustus 2002
  • Niet online
Bij het deployen van mijn webapp onder Tomcat 4.0.6 krijg ik de volgende melding:
code:
1
2
3
4
Starting service Tomcat-Standalone
Apache Tomcat/4.0.6
ERROR reading java.io.ByteArrayInputStream@530cf2
At Line 34 /web-app/login-config/
Ik dacht in eerste instantie dat de encoding van de web.xml wellicht problemen gaf, maar het is gewoon een iso-8859-1 bestand zonder vreemde tekens. Het probleem zit blijkbaar op regel 34, maar ik staar me gewoon helemaal blind. Iemand dit wel eens eerder gezien?

De web.xml van de webapp ziet er als volgt uit:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

    <security-constraint>
        <display-name>Security Constraint</display-name>
        <web-resource-collection>
            <web-resource-name>Protected Area</web-resource-name>
            <!-- Define the context-relative URL(s) to be protected -->
            <url-pattern>/*</url-pattern>
            <!-- If you list http methods, only those methods are protected -->
            <http-method>DELETE</http-method>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>PUT</http-method>
        </web-resource-collection>
        <auth-constraint>
            <!-- Anyone with one of the listed roles may access this area -->
            <role-name>admin</role-name>
        </auth-constraint>
    </security-constraint>
    
    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>Form-Based Authentication Area</realm-name>
        <form-login-config>
            <form-login-page>login.jsp</form-login-page>
            <form-error-page>error.jsp</form-error-page>
        </form-login-config>
    </login-config>
    
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>    
    
</web-app>

"Kill one man, and you are a murderer. Kill millions of men, and you are a conqueror. Kill them all, and you are a god." -- Jean Rostand


  • Robtimus
  • Registratie: November 2002
  • Laatst online: 21:44

Robtimus

me Robtimus no like you

Ik heb het even gecopy-paste en door een XML validator gehaald, met het volgende resultaat:
D:/Document.xml [36:24] : Error: element content invalid. Element 'welcome-file-list' is not expected here, expecting 'ejb-local-ref', 'ejb-ref', 'env-entry', 'security-role' or '</web-app>'

Tool completed with exit code 2
De fout komt dus net NA regel 34 misschien? Want daar verwacht hij een ander element.

More than meets the eye
There is no I in TEAM... but there is ME
system specs


  • marcusk
  • Registratie: Februari 2001
  • Laatst online: 26-09-2023
welcome-file-list moet voor login-config staan. Zie de DTD:

<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, filter*, filter-mapping*, listener*, servlet*,
servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>

De foutmelding die je krijgt is helaas niet bepaald duidelijk :)

  • ari3
  • Registratie: Augustus 2002
  • Niet online
Het is opgelost! Het bleek dat er een '/' toegevoegd moest worden, aldus:

code:
1
2
            <form-login-page>/login.jsp</form-login-page>
            <form-error-page>/error.jsp</form-error-page>


Nu wordt de webapp ge-deployed zonder fouten. De foutmelding was helaas niet erg duidelijk waardoor het veel tijd gekost heeft |:(

"Kill one man, and you are a murderer. Kill millions of men, and you are a conqueror. Kill them all, and you are a god." -- Jean Rostand