Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Constructor is not visible

Status
Not open for further replies.

ketandba

Programmer
Nov 15, 2004
38
US
hi,
I got the error...(Constructor is not visible)..

here is my code...

*****

import java.io.FileWriter;
import java.io.IOException;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.xmldb.api.*;
import org.w3c.dom.*;
import com.sleepycat.dbxml.*;

public class InsertInvoiceInfoAction extends Action{
String Idxml ;
String stDate = null;
String stNumber = null ;

public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

String target = new String("success");

if ( form != null ) {
InvoiceInfoForm iif = (InvoiceInfoForm)form;
stDate = iif.getInvDate();
stNumber = iif.getInvNumber();
}
if ( form == null ) {
System.out.println("form is null...in insertInvocieInfoAction class");
}
if (( stDate == null )|| (stNumber == null) ){
System.out.println("date or invNumber is null ");
target = new String("failure");
}
else {
writeXmlToBerkeleyDatabase("InvDetails");
}
return (mapping.findForward(target));
}


public void writeXmlToBerkeleyDatabase(String Idxml)throws Exception {

XmlManager myManager = null;
XmlContainer myContainer = null;
try {

DocumentBuilderFactory dbf =DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc1 = db.newDocument();
Element main,root,outitem;

main = doc1.createElement("Document");
main.appendChild(doc1.createTextNode("\n"));

outitem = doc1.createElement("inv-date");
outitem.appendChild(doc1.createTextNode(stDate));
main.appendChild(outitem);
main.appendChild(doc1.createTextNode("\n"));

outitem = doc1.createElement("inv-number");
outitem.appendChild(doc1.createTextNode(stNumber));
main.appendChild(outitem);
main.appendChild(doc1.createTextNode("\n"));

doc1.appendChild(main);
String docString =doc1.toString();
// Here i get the error

XmlDocument myXmlDoc =
new XmlDocument();

// The Constructor XmlDocument is not visible

myXmlDoc.setContent(docString);
myManager = new XmlManager();

myContainer =
myManager.openContainer("myContainer4.bdbxml");

myContainer.putDocument(Idxml, docString, null,0);

System.out.println("Document inserted ====> " + docString);
} catch (Exception e) {
System.out.println(e.getMessage() + e.toString());
}

finally {
try {
if (myContainer != null) {
myContainer.close();
}

if (myManager != null) {
myManager.close();
}
} catch (Exception ce) {
System.out.println(ce.getMessage() + ce.toString());
}
}
}// end writexmlToBerkeleyDatabase

}

******
Thanks in advanced..

ketan
 
And your constructors for the class "XmlDocument" look like ...

--------------------------------------------------
Free Database Connection Pooling Software
 
hi,
Sedj,
Thanks for reply..

you have answer me

And your constructors for the class "XmlDocument" look like ...

but i can't understand what you say..

Actuly i am using dbxml.jar in which XmlDocument class resides.. i have not write it...

pl. reply specific solution for this proble...

sorry for inconvinance cause to you...

ketan
 
Have you got any documentation for this "XmlDocument" class ? What do the constructor signatures look like ?

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top