Cita:
Sin embargo, si se accede a la aplicacion desde otra pc y envio el mismo archivo el error cambia[ERROR FATAL row:2 col:6]
The processing instruction target matching "[xX][mM][lL]" is not allowed.
The processing instruction target matching "[xX][mM][lL]" is not allowed.
Cita:
El siguiente texto es mi esquemaString index out of range = -1
Código:
Y este es mi archivo XML<?xml version="1.0" encoding="utf-8" ?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!-- Elemento Principal --> <xsd:element name="IRU_ReclamosServicio" > <xsd:complexType> <xsd:sequence> <xsd:element name="Registro" type="bodySchema" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <!-- Cuerpo del Esquema --> <xsd:complexType name="bodySchema" mixed="true"> <xsd:sequence> <xsd:element name="CodigoServicio" type="tipoCodigoServicio" /> <xsd:element name="CodigoMes" type="tipoCodigoMes" /> <xsd:element name="CantidadReclamos" type="tipoCantidadReclamos" /> </xsd:sequence> </xsd:complexType> <!-- sub tipos de elementos principales --> <xsd:simpleType name="tipoCodigoServicio"> <xsd:restriction base="xsd:positiveInteger"> <xsd:maxInclusive value="8"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="tipoCodigoMes"> <xsd:restriction base="xsd:positiveInteger"> <xsd:maxInclusive value="12"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="tipoCantidadReclamos"> <xsd:restriction base="xsd:int"> <xsd:minInclusive value="0"/> </xsd:restriction> </xsd:simpleType> </xsd:schema>
Código:
Ademas, cuento con una clase que valida lo de la ruta larga... y q al parecer tiene algo de malo. Aqui les pongo el metodo que considera eso<?xml version="1.0" encoding="utf-8" ?> <IRU_ReclamosServicio xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation='http://localhost:8080/Sigotel/TransaccionesXML/temporal/frmtDirectory/IRU_ReclamosServicio.xsd'> <Registro> <CodigoServicio>1</CodigoServicio> <CodigoMes>10</CodigoMes> <CantidadReclamos>2654</CantidadReclamos> </Registro> <Registro> <CodigoServicio>3</CodigoServicio> <CodigoMes>11</CodigoMes> <CantidadReclamos>26</CantidadReclamos> </Registro> <Registro> <CodigoServicio>3</CodigoServicio> <CodigoMes>12</CodigoMes> <CantidadReclamos>2441</CantidadReclamos> </Registro> </IRU_ReclamosServicio>
Código:
no encuentro el error por ningun lado. Por favor podrian ayudarme? public void doUpload(HttpServletRequest request) throws IOException
{
ServletInputStream in = request.getInputStream();
byte line[] = new byte[128];
int i = in.readLine(line, 0, 128);
if(i < 3)
return;
int boundaryLength = i - 2;
String boundary = new String(line, 0, boundaryLength);
fields = new Hashtable();
for(; i != -1; i = in.readLine(line, 0, 128))
{
String newLine = new String(line, 0, i);
if(!newLine.startsWith("Content-Disposition: form-data; name=\""))
continue;
if(newLine.indexOf("filename=\"") != -1)
{
setFileName(new String(line, 0, i - 2));
if(fileName == null)
return;
i = in.readLine(line, 0, 128);
setContentType(new String(line, 0, i - 2));
i = in.readLine(line, 0, 128);
i = in.readLine(line, 0, 128);
buffer = new ByteArrayOutputStream();
for(newLine = new String(line, 0, i); i != -1 && !newLine.startsWith(boundary); newLine = new String(line, 0, i))
{
buffer.write(line, 0, i);
i = in.readLine(line, 0, 128);
if((buffer.size()/1024.0)>getSIZE_KILOBYTES()){
setUploaded(false);
buffer = null;
break;
}
}
continue;
}
int pos = newLine.indexOf("name=\"");
String fieldName = newLine.substring(pos + 6, newLine.length() - 3);
i = in.readLine(line, 0, 128);
i = in.readLine(line, 0, 128);
newLine = new String(line, 0, i);
StringBuffer fieldValue = new StringBuffer(128);
for(; i != -1 && !newLine.startsWith(boundary); newLine = new String(line, 0, i))
{
i = in.readLine(line, 0, 128);
if((i == boundaryLength + 2 || i == boundaryLength + 4) && (new String(line, 0, i)).startsWith(boundary))
fieldValue.append(newLine.substring(0, newLine.length() - 2));
else
fieldValue.append(newLine);
}
fields.put(fieldName, fieldValue.toString());
}
if(existe)
{
/*File f = new File(String.valueOf(savePath != null ? ((Object) (savePath)) : "") + String.valueOf(fileName));
if(f.length() > (long)4095)
f.delete();
f = null;*/
}
}
muchas gracias!!

