Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Schema and Element do not match

404911Oct 7 2003 — edited Oct 15 2003
when using an example po.xsd and th PurchaseOrder.xml from oracle's tutorial I was getting this error. First Mark suggested that I include elementFormDefault="qualified" as one of the schema attributes, that did not fix the issue.
Then, it was suggested to use oracle db 9.2.0.3 or later to elliminate this issue. I switched to oracle 9.2.0.3 and when registering the .xsd I get the following error:
ORA-00600: internal error code, arguments: [qmxiUnpPacked2], [121], [], [], [],
[], [], []
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 80
ORA-06512: at line 1

Also I tried deleting an xsd that does not exist and istead of getting an error that the xsd is not registered once again I got :
ORA-00600: internal error code, arguments: [qmxiUnpPacked2], [121], [], [], [],
[], [], []
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 80
ORA-06512: at line 1
please advice

Comments

Kayaman
You can create a HTTP request and pass the return value as an URL parameter (or if the page uses POST, pass it that way).
srhcan
Kayaman wrote:
You can create a HTTP request and pass the return value as an URL parameter (or if the page uses POST, pass it that way).
can you give example of this (how to create HTTP request and passing the value)? Thanks
Kayaman
You can use the HttpURLConnection class, or get an easier to use library, such as the apache HttpClient.

Tens of thousands of examples on both available on the internet.
srhcan
ok I tried a simple test and it is not working, can anyobdy tell me what I am doing wrong here?

I created a web application project JEE_Test
I created 2 jsp: First.jsp and Second.jsp
I created 1 class: Test.java

First.jsp instanstiates Test.java and calls its method redirect() which creates the HTTP request for Second.jsp.
What I want is that I will call the First.jsp as http://localhost:8080/JEE_Test/First.jsp and I will get the Second.jsp

This is my First.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@page import="com.test.Test"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>First.jsp</title>
</head>

<body>

<%
Test test = new Test();
System.out.println("First.jsp: test object created");

test.redirect();
%>

FIRST

</body>

</html>
This is my Second.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Second.jsp</title>

<script type="text/javascript">
function executeAfterLoad() {
	alert("Second.jsp: inside executeAfterLoad()");
}
</script>
</head>

<body onload="executeAfterLoad();">

SECOND

</body>

</html>
This is my Test.java:
package com.test;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;

public class Test {

	public void redirect() {
		
		HttpURLConnection connection = null;
		
		try {
			String message = URLEncoder.encode("ABC", "UTF-8");
			System.out.println("Test.java: redirect(): message=" + message);
			
			URL url = new URL("http://localhost:8080/JEE_Test/Second.jsp");
			System.out.println("Test.java: redirect(): url=" + url);
			
			connection = (HttpURLConnection) url.openConnection();
			System.out.println("Test.java: redirect(): connection=" + connection);
			
			connection.setDoOutput(true);
			System.out.println("Test.java: redirect(): after connection.setDoOutput()");
			
			connection.setRequestMethod("POST");
			System.out.println("Test.java: redirect(): after connection.setRequestMethod()");
			
			OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
			System.out.println("Test.java: redirect(): writer=" + writer);
			
			writer.write("message=" + message);
			System.out.println("Test.java: redirect(): after writer.write()");
			
			writer.flush();
			System.out.println("Test.java: redirect(): after writer.flush()");
			
			writer.close();
			System.out.println("Test.java: redirect(): after writer.close()");

			System.out.println("Test.java: redirect(): connection.getResponseCode()=" + connection.getResponseCode());
			System.out.println("Test.java: redirect(): HttpURLConnection.HTTP_OK=" + HttpURLConnection.HTTP_OK);
			
			// if there is a response code AND that response code is 200 OK, do stuff in the first if block
	        if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
	            // OK

	        // otherwise, if any other status code is returned, or no status code is returned, do stuff in the else block
	        } else {
	            // Server returned HTTP error code.
	        }
	        
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
			
		} catch (MalformedURLException e) {
			e.printStackTrace();
			
		} catch (IOException e) {
			e.printStackTrace();
			
		} finally {
			
			if (connection != null)
				connection.disconnect();
		}
		
		
	}
	
}
But this is not happening; I stay at First.jsp instead of getting Second.jsp. I am getting connection.getResponseCode() as 200.

What I am doing wrong? Please help.

Edited by: srhcan on Mar 5, 2013 5:44 PM

Edited by: srhcan on Mar 5, 2013 5:44 PM

Edited by: srhcan on Mar 5, 2013 5:45 PM
r035198x
You don't need HttpURLConnection to navigate between JSPs in the same web application. Read about how to use RequestDispatcher here http://docs.oracle.com/javaee/5/tutorial/doc/bnagi.html, or better yet dump, JSP and use JSF with facelets, it already comes with a versatile navigation mechanism.
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 12 2003
Added on Oct 7 2003
13 comments
301 views