Iterator exception

i get this exception:
Business Server Page (BSP) Fehler
Was ist passiert?
Der Aufruf der BSP-Seite wurde aufgrund eines Fehlers abgebrochen.
Hinweis
Folgender Fehlertext wurde im System prozessiert:
Eine Exception vom Typ CX_SY_DYN_CALL_ILLEGAL_METHOD ist aufgetreten, wurde aber weder lokal behandelt noch durch eine RAISING-Klausel deklariert.
Exception Class CX_SY_DYN_CALL_ILLEGAL_METHOD
Error Id 
Programm CL_HTMLB_TABLEVIEW============CP
Include CL_HTMLB_TABLEVIEW============CCIMP
Zeile 1766 
Lang-Text -
I had read Brian McKellar weblog. After m_row_ref ?= p_row_ref it happened. My Problem is that I have an structure and not a table. So m_row_ref type ref to zstruc_xxx and not sflight. Anyone have an idea ?
thx

Hi Marcel,
Actually you already give a hint to the problem. Within the object CL_HTMLB_TABLEVIEW this error occurs when the program tries to set the next row (for a tableview) and when not found, leaves the method.
In your case you have created a type reference to a structure and via casting want to link an internal table or tabletype to it.
One solution is the create your own table based on your ZSTRUC_XXX (or SFLIGHT) structure. Do your casting assignment and after this read the one line from it into your structure.
Something like this:
DATA: ZSTRUC_XXX TYPE SFLIGHT.
DATA: ZTSTRUC_XXX TYPE ZSTRUC_XXX OCCURS 1.
DATA: M_ROW_REF TYPE REF TO ZTSTRUC_XXX.
M_ROW_REF ?= P_ROW_REF.
READ TABLE ZTSTRUC_XXX INDEX 1 INTO ZSTRUC_XXX.
Hope this gives you some clues.
Regards,
Rob.

Similar Messages

  • Problem in publishing web service

    i am getting problems in publishing coffee break
    service given in jawa web server development package
    exercise samples
    i ran "ant run-publish"
    i got the below response:
    javax.xml.registry.JAXRException:JAXR.UDDI.091:No
    concept specified for this classification
    at
    sun.com.xml.registry.uddi.UDDIMAPPER.classification2CategoryBag(Unknown
    Source)
    at
    sun.com.xml.registry.uddi.UDDIMAPPER.organisation2BuisinessEntity(Unknown
    Source)
    at
    sun.com.xml.registry.uddi.UDDIMAPPER.organisations2BuisinessEntities(Unknown
    Source)
    at
    sun.com.xml.registry.uddi.UDDIMAPPER.saveOrganisations(Unknown
    Source)
    at
    sun.com.xml.registry.uddi.BuisinessLifeCycleManagerImpl.saveOrganisations(Unknown
    Source)
    at JAXRPublish.executePublish(Unknown Source)
    at JAXRPublish.main(Unknown Source)
    The code is :
    import javax.xml.registry.*;
    import javax.xml.registry.infomodel.*;
    import java.net.*;
    import java.security.*;
    import java.util.*;
    * The JAXRPublish class consists of a main method, a
    * makeConnection method, and an executePublish
    method.
    * It creates an organization and publishes it to a
    registry.
    public class JAXRPublish {
    Connection connection = null;
    public JAXRPublish() {}
    public static void main(String[] args) {
    ResourceBundle bundle =
    ResourceBundle.getBundle("JAXRExamples");
    String queryURL =
    bundle.getString("query.url");
    String publishURL =
    bundle.getString("publish.url");
    // Edit to provide your own username and
    password
    // Defaults for Registry Server are
    testuser/testuser
    String username =
    bundle.getString("registry.username");
    String password =
    bundle.getString("registry.password");
    JAXRPublish jp = new JAXRPublish();
    jp.makeConnection(queryURL, publishURL);
    jp.executePublish(username, password);
    * Establishes a connection to a registry.
    * @param queryUrl     the URL of the query registry
    * @param publishUrl     the URL of the publish
    registry
    public void makeConnection(String queryUrl,
    String publishUrl) {
    * Specify proxy information in case you
    * are going beyond your firewall.
    ResourceBundle bundle =
    ResourceBundle.getBundle("JAXRExamples");
    String httpProxyHost =
    bundle.getString("http.proxyHost");
    String httpProxyPort =
    bundle.getString("http.proxyPort");
    String httpsProxyHost =
    bundle.getString("https.proxyHost");
    String httpsProxyPort =
    bundle.getString("https.proxyPort");
    * Define connection configuration properties.
    * To publish, you need both the query URL and
    the
    * publish URL.
    Properties props = new Properties();
    props.setProperty("javax.xml.registry.queryManagerURL",
    queryUrl);
    props.setProperty("javax.xml.registry.lifeCycleManagerURL",
    publishUrl);
    props.setProperty("com.sun.xml.registry.http.proxyHost",
    httpProxyHost);
    props.setProperty("com.sun.xml.registry.http.proxyPort",
    httpProxyPort);
    props.setProperty("com.sun.xml.registry.https.proxyHost",
    httpsProxyHost);
    props.setProperty("com.sun.xml.registry.https.proxyPort",
    httpsProxyPort);
    try {
    // Create the connection, passing it the
    // configuration properties
    ConnectionFactory factory =
    ConnectionFactory.newInstance();
    factory.setProperties(props);
    connection = factory.createConnection();
    System.out.println("Created connection to
    registry");
    } catch (Exception e) {
    e.printStackTrace();
    if (connection != null) {
    try {
    connection.close();
    } catch (JAXRException je) {}
    * Creates an organization, its classification,
    and its
    * services, and saves it to the registry.
    * @param username the username for the registry
    * @param password the password for the registry
    public void executePublish(String username,
    String password) {
    RegistryService rs = null;
    BusinessLifeCycleManager blcm = null;
    BusinessQueryManager bqm = null;
    try {
    rs = connection.getRegistryService();
    blcm = rs.getBusinessLifeCycleManager();
    bqm = rs.getBusinessQueryManager();
    System.out.println("Got registry service,
    query " +
    "manager, and life cycle manager");
    // Get authorization from the registry
    PasswordAuthentication passwdAuth =
    new PasswordAuthentication(username,
    password.toCharArray());
    Set creds = new HashSet();
    creds.add(passwdAuth);
    connection.setCredentials(creds);
    System.out.println("Established security
    credentials");
    ResourceBundle bundle =
    ResourceBundle.getBundle("JAXRExamples");
    // Create organization name and
    description
    Organization org =
    blcm.createOrganization(bundle.getString("org.name"));
              //System.out.println(bundle.getString("org.name"));
    InternationalString s =
    blcm.createInternationalString(bundle.getString("org.description"));
    org.setDescription(s);
    // Create primary contact, set name
    User primaryContact = blcm.createUser();
    PersonName pName =
    blcm.createPersonName(bundle.getString("person.name"));
    primaryContact.setPersonName(pName);
    // Set primary contact phone number
    TelephoneNumber tNum =
    blcm.createTelephoneNumber();
    tNum.setNumber(bundle.getString("phone.number"));
    Collection phoneNums = new ArrayList();
    phoneNums.add(tNum);
    primaryContact.setTelephoneNumbers(phoneNums);
    // Set primary contact email address
    EmailAddress emailAddress =
    blcm.createEmailAddress(bundle.getString("email.address"));
    Collection emailAddresses = new
    ArrayList();
    emailAddresses.add(emailAddress);
    primaryContact.setEmailAddresses(emailAddresses);
    // Set primary contact for organization
    org.setPrimaryContact(primaryContact);
    // Set classification scheme to NAICS
    ClassificationScheme cScheme =
    bqm.findClassificationSchemeByName(null,
    bundle.getString("classification.scheme"));
    // Create and add classification
    Classification classification =
    blcm.createClassification(cScheme,
    bundle.getString("classification.name"),
    bundle.getString("classification.value"));
    Collection classifications = new
    ArrayList();
    classifications.add(classification);
    org.addClassifications(classifications);
    // Create services and service
    Collection services = new ArrayList();
    Service service =
    blcm.createService(bundle.getString("service.name"));
    InternationalString is =
    blcm.createInternationalString(bundle.getString("service.description"));
    service.setDescription(is);
    // Create service bindings
    Collection serviceBindings = new
    ArrayList();
    ServiceBinding binding =
    blcm.createServiceBinding();
    is =
    blcm.createInternationalString(bundle.getString("svcbinding.description"));
    binding.setDescription(is);
    // allow us to publish a fictitious URL
    without an error
    binding.setValidateURI(false);
    binding.setAccessURI(bundle.getString("svcbinding.accessURI"));
    serviceBindings.add(binding);
    // Add service bindings to service
    service.addServiceBindings(serviceBindings);
    // Add service to services, then add
    services to organization
    services.add(service);
    org.addServices(services);
    // Add organization and submit to registry
    // Retrieve key if successful
    Collection orgs = new ArrayList();
    orgs.add(org);
    BulkResponse response =
    blcm.saveOrganizations(orgs);
    Collection exceptions =
    response.getExceptions();
    if (exceptions == null) {
    System.out.println("Organization
    saved");
    Collection keys =
    response.getCollection();
    Iterator keyIter = keys.iterator();
    if (keyIter.hasNext()) {
    javax.xml.registry.infomodel.Key
    orgKey =
    (javax.xml.registry.infomodel.Key) keyIter.next();
    String id = orgKey.getId();
    System.out.println("Organization
    key is " + id);
    } else {
    Iterator excIter =
    exceptions.iterator();
    Exception exception = null;
    while (excIter.hasNext()) {
    exception = (Exception)
    excIter.next();
    System.err.println("Exception on
    save: " +
    exception.toString());
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    // At end, close connection to registry
    if (connection != null) {
    try {
    connection.close();
    } catch (JAXRException je) {}
    Please solve my problem.

    I have the same problem when trying to deploy a simple web service with longs and bytes. I still don't know where the error comes from. Did you find something out? Any answer would be welcome.

  • N-ary Trees non-recursive traversal algorithms

    Hi,
    Non-recursive traversals are needed when you are unsure how big the tree's will be. So far all the algorithms I have seen either use their own internal stack
    or threading to climb back up the tree.
    Here's my attempt that seems to work but I would value so critical evaluation
    * An extension of the CommonAST that records the line and column
    * number.  The idea was taken from <a target="_top"
    * href="http://www.jguru.com/jguru/faq/view.jsp?EID=62654">Java Guru
    * FAQ: How can I include line numbers in automatically generated
    * ASTs?</a>.
    * @author Oliver Burn
    * @author lkuehne
    * @version 1.0
    * @see <a target="_top" href="http://www.antlr.org/">ANTLR Website</a>
    public class DetailAST
        public AST getFirstChild()
        public AST getNextSibling()
        public int getChildCount()
        public DetailAST getParent()
        public int getChildCount(int aType)
        public String getText()
    }This was cut back just to give you enough info
         public static AST getLeftMostChild(DetailAST ast) {
              DetailAST tempAst = ast.getFirstChild();
              while (tempAst.getFirstChild() != null) {
                   tempAst = tempAst.getFirstChild();
              return tempAst;
         public static void traverseASTInOrder(DetailAST root) {
              DetailAST current = getLeftMostChild(ast);
              processNode(current);
              while (current != root) {
                   if (current == current.getParent().getFirstChild()) {
                        processNode(current.getParent());
                   if (current.getNextSibling() != null) {
                        DetailAST sibling = current.getNextSibling();
                        if (sibling.getChildCount() != 0) {
                             current = (DetailAST) getLeftMostChild(sibling);
                             processNode(current);
                        } else {
                             current = sibling;
                             processNode(current);
                   } else {
                        current = current.getParent();
            // do stuff at inorder traversal
         public static void processNode(AST current) {
              System.out.println(current.getText());
         }for pre-order and post-order John Cowan put forward this algorithm
    http://lists.xml.org/archives/xml-dev/199811/msg00050.html
    traverse(Node node) {
        Node currentNode = node;
        while (currentNode != null) {
          visit(currentNode); //pre order
          // Move down to first child
          Node nextNode = currentNode.getFirstChild();
          if (nextNode != null) {
            currentNode = nextNode;
            continue;
          // No child nodes, so walk tree
          while (currentNode != null) {
            revisit(currentNode)     // post order
            // Move to sibling if possible.
            nextNode = currentNode.getNextSibling();
            if (nextNode != null) {
              currentNode = nextNode;
              break;
           // Move up
           if (currentNode = node)
          currentNode = null;
           else
          currentNode = currentNode.getParentNode();
      }Any comments, criticisms or suggestions ?
    regards
    David Scurrah

    Stack is recursion? As far as I know recursion is when
    function (method) calls itself. Just using some
    Collection, which java.util.Stack implements is not
    recursion.
    Regards
    PawelStacks are used to implement recursive algorithms. What happens in most languages when you make a function call? Each function has an "activation record" where it stores its local variables and parameters. This activation record is usually allocated on a stack. Thus for any recursive algorithm, there is a non-recursive algorithm that uses a stack.
    In the OP's case you don't need a stack because of the peculiarities of tree traversal when you have a pointer to the parent node. (Namely, no cycles and you can get back to where you've been) So the algorithms he gave should work fine.
    My only "criticism" would be that it may be more useful to implement these algorithms with the iterator pattern. So you would have a tree with some functions like:
    public class Tree{
        public TreeIterator inOrderIteraror();
        public TreeIterator preOrderIterator();
    }Where the TreeIterator would look like a java.util.Iterator, except maybe you want some additional utility methods in there or something.
    Other than that, non-recursive algorithms are defnitely the way to go.

  • Reuse of Map.Entry

    Hi,
    I'm writing some Map implementations and warppers and i have specific question.
    Is Map.Entry reusable after calling next iterator.next().
    Questionable code. Is this valid.
    Map.Entry first = null;
    for( Iterator i = myMap.entrySet().iterator()) {
      Map.Entry entry1 = (Map.Entry)i.next();
      if( first == null) first = entry1;
      // do something with entry
    // do something with first entry <<<<Does do something with "first" is valid operation,
    or entrySet can return the same object for each entry but with
    some different internal data.
    This is performance question, since in my Map implementation there is
    nothing similar to Map.Entry, so I must create new instance
    of wrapper for each iteration.
    I'd like to return always one instance (shared amont Iterator returned by Map.entrySet().iterator()) pointing to different "real" data.
    Thanks.

    This and many more examples, esp. with wrappers or
    or so called "views" shows weaknes of java.util contracts.I think it should be written in documentation of Map interface.It can be found in the javadocs for the Map.Entry interface:
    A map entry (key-value pair). The Map.entrySet method returns a collection-view
    of the map, whose elements are of this class. The only way to obtain a reference
    to a map entry is from the iterator of this collection-view. These Map.Entry objects
    are valid only for the duration of the iteration; more formally, the behavior of a
    map entry is undefined if the backing map has been modified after the entry was
    returned by the iterator, except through the iterator's own remove operation, or
    through the setValue operation on a map entry returned by the iterator.
    kind regards,
    Jos

  • Nikon Nikkor 18-55 (non-VR), 55-200 VR

    I shot images for and made two profiles, available here (and also submitted to Adobe).
    NIKON 18.0-55.0 mm f/3.5-5.6
    NIKON 55.0-200.0 mm f/4.0-5.6
    Both were shot under similar conditions:
    indirect evening sunlight (even and relatively bright, but possibly changing in intensity)
    8.5"x11" print on plain paper (crisp and high contrast, but subject to a little warping)
    from a tripod (only pivoting the camera during each iteration, not panning)
    one focal distance per focal length, all at f11 and ISO 100
    nine images per shooting iteration (except one of the 18-55's iterations, for which I forgot one image)
    three iterations for the 18-55 (18, 35, 55); five for the 55-200 (55, 70, 102, 135, 200)
    RAW images (NEF, converted to DNG for the profile creator)
    default settings except for entering dimensions for the profile creator
    using a Nikon D40x
    I posted a few example images are included as well, in case they are of interest. (If anyone is interested in the RAW images, I'd be glad to share those as well.)

    I have moved the profiles (retiring the server which I had them on before): http://www.markfickett.com/lensprofiles/.

  • I can not publish and query services in Registry Server?Help please!

    I want to use Registry Server in Jwsdp1.5 to publish and query services,but there is some problems:
    2006-4-26 10:05:26 com.sun.registry_server.server.RegistryServerServlet init
    ����: NamingException: javax.naming.NameNotFoundException: Name org.xml.sax.driver is not bound in this Context
    2006-4-26 10:05:27 com.sun.xml.messaging.saaj.soap.MessageImpl identifyContentType
    ����: SAAJ0537: ������������������������������������ SOAP ����
    2006-4-26 10:05:27 com.sun.xml.messaging.saaj.soap.MessageImpl <init>
    ����: SAAJ0535: ��������������
    javax.xml.registry.JAXRException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
         at com.sun.xml.registry.uddi.RegistryServiceImpl.jaxmSend(Unknown Source)
         at com.sun.xml.registry.uddi.RegistryServiceImpl.send(Unknown Source)
         at com.sun.xml.registry.uddi.Processor.processRequestJAXB(Unknown Source)
         at com.sun.xml.registry.uddi.UDDIMapper.findOrganizations(Unknown Source)
         at com.sun.xml.registry.uddi.BusinessQueryManagerImpl.findOrganizations(Unknown Source)
         at QueryByName.doPost(QueryByName.java:63)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:790)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:709)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:572)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:127)
         ... 34 more
    Caused by: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
         ... 34 more
    Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
         at com.sun.xml.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:231)
         at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.<init>(Message1_1Impl.java:43)
         at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:32)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:354)
         at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:150)
         ... 36 more
    Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?
         at com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentType(MessageImpl.java:295)
         at com.sun.xml.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:146)
         ... 40 more
    can you help me?expectiong your advise!thank you

    I have created my own private registry, I hava installed JWSDP1.5.
    I use a .jsp file and a servlet to publish services,the servlet is:
    import javax.xml.registry.*;
    import javax.xml.registry.infomodel.*;
    import java.net.*;
    import java.security.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class Publish extends HttpServlet{
         public void doGet(HttpServletRequest request,HttpServletResponse response)
         throws ServletException,IOException{
              doPost(request,response);
         public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
         String userName=request.getParameter("username");
         String authPassword=request.getParameter("password");
         Connection connection = null;
    RegistryService rs=null;
    BusinessLifeCycleManager blcm=null;
    BusinessQueryManager bqm = null;
         Properties props=new Properties();
    props.setProperty("javax.xml.registry.queryManagerURL","http://localhost:8080/RegistryServer");
    props.setProperty("javax.xml.registry.lifeCycleManagerURL","http://localhost:8080/RegistryServer");
    props.setProperty("javax.xml.registry.factoryClass","com.sun.xml.registry.uddi.ConnectionFactoryImpl");
    //props.setProperty("com.sun.xml.registry.http.proxyHost",httpHost);
    //props.setProperty("com.sun.xml.registry.http.proxyPort",httpPort);
    // props.setProperty("com.sun.xml.registry.https.proxyHost",httpsHost);
    // props.setProperty("com.sun.xml.registry.https.proxyPort",httpsPort);
    try{
    // Create the connection, passing it the
    // configuration properties
    ConnectionFactory factory =
    ConnectionFactory.newInstance();
    factory.setProperties(props);
    connection=factory.createConnection();
    PrintWriter out=response.getWriter();
    out.println("<a href=\"/publishapp/publish.jsp\">You can click here to be Back </a>");
    out.println("<H3>Created connection to registry</H3>");
    rs=connection.getRegistryService();
    blcm = rs.getBusinessLifeCycleManager();
    bqm = rs.getBusinessQueryManager();
    //out.println("Got registry service, query " +"manager, and life cycle manager");
    // Get authorization from the registry
    PasswordAuthentication passwdAuth =
    new PasswordAuthentication(userName,authPassword.toCharArray());
    Set creds = new HashSet();
    creds.add(passwdAuth);
    connection.setCredentials(creds);
    out.println("<br>");
    out.println("<H3>Established security credentials</H3>");
    //receive organization name and description
    String orgName=request.getParameter("orgname");
    String orgDescription=request.getParameter("orgdescription");
    // Create organization name and description
    Organization org =
    blcm.createOrganization(orgName);
    InternationalString s =
    blcm.createInternationalString(orgDescription);
    org.setDescription(s);
    //receive contactor name phone and Email
    String contactName=request.getParameter("contactname");
    String contactPhone=request.getParameter("contactphone");
    String contactEmail=request.getParameter("contactemail");
    // Create primary contact, set name
    User primaryContact = blcm.createUser();
    PersonName pName =
    blcm.createPersonName(contactName);
    primaryContact.setPersonName(pName);
    // Set primary contact phone number
    TelephoneNumber tNum = blcm.createTelephoneNumber();
    tNum.setNumber(contactPhone);
    Collection phoneNums = new ArrayList();
    phoneNums.add(tNum);
    primaryContact.setTelephoneNumbers(phoneNums);
    // Set primary contact email address
    EmailAddress emailAddress =blcm.createEmailAddress(contactEmail);
    Collection emailAddresses = new ArrayList();
    emailAddresses.add(emailAddress);
    primaryContact.setEmailAddresses(emailAddresses);
    // Set primary contact for organization
    org.setPrimaryContact(primaryContact);
    String serviceName=request.getParameter("servicename");
    String serviceDescription=request.getParameter("servicedescription");
    String serviceURL=request.getParameter("serviceurl");
    String svcbindDescription=request.getParameter("svcbinddescription");
    // Create services and service
    Collection services = new ArrayList();
    Service service =
    blcm.createService(serviceName);
    InternationalString is =
    blcm.createInternationalString(serviceDescription);
    service.setDescription(is);
    // Create service bindings
    Collection serviceBindings = new ArrayList();
    ServiceBinding binding = blcm.createServiceBinding();
    is = blcm.createInternationalString(svcbindDescription);
    binding.setDescription(is);
    // allow us to publish a fictitious URL without an error
    binding.setValidateURI(false);
    binding.setAccessURI(serviceURL);
    serviceBindings.add(binding);
    // Add service bindings to service
    service.addServiceBindings(serviceBindings);
    // Add service to services, then add services to organization
    services.add(service);
    org.addServices(services);
    //receive Classification scheme name and value
    String classificationScheme=request.getParameter("classificationscheme");
    String classificationName=request.getParameter("classificationname");
    String classificationValue=request.getParameter("classificationvalue");
    // Set classification scheme to NAICS
    ClassificationScheme cScheme =
    bqm.findClassificationSchemeByName(null, classificationScheme);
    // Create and add classification
    Classification classification = blcm.createClassification(cScheme,
    classificationName,classificationValue);
    Collection classifications = new ArrayList();
    classifications.add(classification);
    org.addClassifications(classifications);
    // Add organization and submit to registry
    // Retrieve key if successful
    Collection orgs = new ArrayList();
    orgs.add(org);
    BulkResponse response1 = blcm.saveOrganizations(orgs);
    Collection exceptions = response1.getExceptions();
    if (exceptions == null) {
    out.println("<br>");
    out.println("<H3>Service Registering is Sucessful!</H3>");
    out.println("<br>");
    out.println("<H3>service information saved is</H3>");
    out.println("<H3>");
    out.println(orgName);
    out.println("</H3>");
    Collection keys = response1.getCollection();
    Iterator keyIter = keys.iterator();
    if (keyIter.hasNext()) {
    javax.xml.registry.infomodel.Key orgKey =
    (javax.xml.registry.infomodel.Key) keyIter.next();
    String id = orgKey.getId();
    out.println("<H3>service key is </H3>");
    out.println("<H3>");
    out.println(id);
    out.println("</H3>");
    } else {
    Iterator excIter = exceptions.iterator();
    Exception exception = null;
    while (excIter.hasNext()) {
    exception = (Exception) excIter.next();
    System.err.println("Exception on save: " +
    exception.toString());
    } catch (Exception e) {
    e.printStackTrace();}
    the exception in the tomcat50-jwsdp/logs:
    javax.xml.registry.JAXRException: javax.xml.bind.JAXBException
    - with linked exception:
    [javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Provider com.sun.xml.messaging.saaj.soap.MessageImpl could not be instantiated: java.lang.IllegalAccessException: Class javax.xml.soap.FactoryFinder can not access a member of class com.sun.xml.messaging.saaj.soap.MessageImpl with modifiers "protected"]
         at com.sun.xml.registry.uddi.Processor.processRequestJAXB(Unknown Source)
         at com.sun.xml.registry.uddi.UDDIMapper.getAuthorizationToken(Unknown Source)
         at com.sun.xml.registry.uddi.ConnectionImpl.setCredentials(Unknown Source)
         at Publish.doPost(Publish.java:66)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:790)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:709)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:572)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.xml.bind.JAXBException
    - with linked exception:
    [javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Provider com.sun.xml.messaging.saaj.soap.MessageImpl could not be instantiated: java.lang.IllegalAccessException: Class javax.xml.soap.FactoryFinder can not access a member of class com.sun.xml.messaging.saaj.soap.MessageImpl with modifiers "protected"]
         at com.sun.xml.registry.common.util.MarshallerUtil.jaxbMarshalObject(Unknown Source)
         ... 32 more
    expecting yours advise, thanks!!

  • Null Pointer Exception with iterator

    Hi,
    I'm trying to use an iterator on a collection bound to a jsf page fragment through datacontrol (data is retrieved from a web service).
    Everything works fine except when this collection is null; I'm then getting a null pointer exception.
    Is there an equivalent of <af:table emptytext="">? Or maybe, is there somewhere where I can configure my datacontrol to always return an empty collection instead of null?
    Thanks.
    Edit: my mistake; I made an error in the binding, which was pointing to another iterator already used.
    Edited by: 965573 on 16 oct. 2012 02:17

    Hi,
    You can try not to render the table when the length of the Collection is zero. This can be done by a JSTL function "length" available at:
    http://java.sun.com/jsp/jstl/functions
    Ex:#{fn:length(bindings.Collection)>0}"
    Thanks,

  • Too many open cursors exception caused by LRS Iterator

    Using Kodo4.1.4 with Oracle10, and Large Result Set Proxies, I encountered
    the error "maximum number of open cursors exceeded".
    It seems to have been caused because of incomplete LRSProxy iterators within
    the context of a single PersistenceManager. These iterators were over
    collections obtained by reachability, not directly from Queries or Extents.
    The Iterator is always closed, but the max-cursors exception still occurs.
    Following is a pseudocode example of the case... Note that if the code is
    refactored to remove the break; statement, then the program works fine, with
    no max-cursors exception.
    Any suggestions?
    // This code pattern is called hundreds of times
    // within the context of a PersistenceManager
    Collection c = persistentObject.getSomeCollection(); // LRS Collection
    Iterator i = c.iterator()
    try
    while(i.hasNext())
    Object o = i.next();
    if (someCondition)
    break; // if this break is removed, everything is fine
    finally
    KodoJDOHelper.close(i);
    }

    XSQL Servlet v. 0.9.9.1
    Netscape Enterprise / JRUN 2.3.3 / Windows NT
    I modified the document demo (insert request).
    The XSQL document:
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="newdocinsform.xsl"?>
    <page connection="demo" xmlns:xsql="urn:oracle-xsql">
    <xsql:insert-request table="xmlclob" transform="newdocins.xsl"/>
    <data>
    <xsql:query null-indicator="yes" max-rows="4">
    select id, doc
    from xmlclob
    order by id desc
    </xsql:query>
    </data>
    </page>
    The difference between this and your demo is the table: the table xmlclob has
    ID NUMBER and DOC CLOB. No constraints were enforced, so I was inserting the ID and the DOC. Upon page reload, several rows with the same values were inserted.
    I had a similar problem in the previous release.
    As a general question, how can I configure the XSQLConfig file for optimal performance?
    Although you provided default values, I'm not sure how much is necessary for connection pooling.

  • Object reference NULL exception is occuring at the time of iterating the projectCustomFieldRows

    Hi ,
    I'm gettign object reference NULL exception in the following for each statement.  Please help me to resolve this issue.
    foreach (SvcProject.ProjectDataSet.ProjectCustomFieldsRow row in prjDataSetValues.ProjectCustomFields.Rows)
                        //check if the GUID is the same
                        //a93fa9de-98a8-4477-8b9b-760f7f7b7bb5
                        eventLog.WriteEntry("Inside the for each  the value of row.MD_PROP_UID is :" + row.MD_PROP_UID);
                        if ((row.MD_PROP_UID == myCustomFieldId) && (row.PROJ_UID == myProjectId))
                            //if yes, write it into the container
                            row.NUM_VALUE = 12345;
                            eventLog.WriteEntry("Inside the equal condition");
                            //and set the indicater
                            updatedata = true;
                            break;

    getting the exception at the time of creating the user using opensso api

  • Concurrent modification exception while iterating through list

    Hi,
    I have a list of objects. I use for each loop in java to iterate through that list of objects and display them.
    The problem is that while iterating other thread can add or remove some objects from that list, and I get ConcurrentModificationException.
    How can I handle this problem. How can I be sure that I am iteration through the updated list.
    Thank you

    Synchonize on the list before iterating through it, and make sure that other code also synchronizes on the list before adding to it or removing from it. Using a list implementation that simply synchronizes all the methods (e.g. Vector) will not do that, you have to do it yourself.

  • While iterating through cursor,system reset, refere to exception in thread

    here is the exception,thanks.
    ====================== EXCEPTION ======================
    NIP: C0A4FB54 XER: 20000000 LR: C0A5ABD0 SP: C53C2CB0 REGS: c53c2c00 TRAP: 0300
    Not tainted
    MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
    DAR: 0000000C, DSISR: 22000000
    TASK = c109a000[43] 'SCH4' Last syscall: -1
    last math 00000000 last altivec 00000000
    GPR00: D9A66038 C53C2CB0 C109A000 D9800510 00000000 00000001 00000001 00000000
    GPR08: 00000000 D9A7F990 D9A11530 00000000 FFFFFFFF 68EAF35D EB33E86E F9EDE7DD
    GPR16: ECFBB73E 00141001 C60FDFFF EF7D6FFF 003FF000 C00E590C C00E0000 C00E5910
    GPR24: C00E0000 C106C3A8 00000000 C00A0000 C00E56E8 C53C2D28 C0C216F4 C53C2CB0
    Cpu Type: PPC603
    task:SCH4 pid:43
    Call backtrace:
    c0c05a08 s_kth_c_thread_wrapper +3f3fa5f8 s_v2k_c_task_wrapper( )
    c0c216f4 s_v2k_c_task_wrapper +3f3de90c s_OSS_Sche_c_ScheTaskEntry( 4 )
    c08c40cc s_OSS_Sche_c_ScheTaskEntry +3f4 RunProcess( d9134090 )
    c08c4888 RunProcess +30 DMA_MODE_WRITE( d9134090 )
    c08cb8f8 DMA_MODE_WRITE +24 UniProcEntry( d9134090 )
    c08c4920 UniProcEntry +3f73b6e0 processP15Timer( )
    c091f074 processP15Timer +2e4 s_tk_15min_c_getAllMcuaddr( c53c2f88 )
    c092120c s_tk_15min_c_getAllMcuaddr +54 Select( a, 0, 80000000, c53c2f58, c53c2f54, 0, 0 )
    c094a0cc Select +3f6b5f34 __db_c_get_pp( d9a11530, c53c2e98,c53c2eb8, 10 )
    c0a6aa2c __db_c_get_pp +120 __db_c_get( d9a11530, c53c2e98, c53c2eb8, 10 )
    c0a5af84 __db_c_get +570 __db_c_idup( d9a11530, c53c2d80, 16 )
    c0a5ab50 __db_c_idup +7c __db_cursor_int( d9800510, 0, 1, 1, 0, 0, c53c2d28 )
    Stack: (0xc53c2cb0 to 0xc53c30b0)
    2ca0: c53c2d10 6b2100a8 d9800510 00000000
    2cc0: 00000001 00000001 00000000 00000000 c53c2d28 d9a7f990 aaaaaaca d9800950
    2ce0: 00000000 c53c2d90 00000000 c53ad600 c53c2ac7 c00e6978 00000000 00000007
    2d00: fffffffe d11c0200 c53c27ef c53c2d10 c53c2d60 c0a5abd0 d9a11530 c53c2d80
    2d20: 00000016 d9800510 00000000 c00a0000 c00e56e8 d333f320 c0c216f4 c53c2d60
    2d40: c53c2d70 c0c0bd0c d9800950 c00c8c40 00000000 d50553fc 00000000 c53c2d60
    2d60: c53c2e00 c0a5b4f8 d9a11530 c53c2e98 c53c2eb8 00000010 d9800510 c00c8c40
    2d80: 00000000 00000000 d9a7fad0 00000000 d9800950 d9800dd0 c0175b90 00000000
    2da0: 00000000 00000016 00000000 00000000 c53c2e00 00000000 d9a11530 c53c2e98
    2dc0: c53c2eb8 00000000 d9800510 0000000a 00000000 00000000 00000000 00000000
    2de0: 0000000c d50553fc c00e0000 c53c2df0 c53c2e10 c08ce3a0 00000324 c53c2e00
    2e00: c53c2e40 c0a6ab50 d9a11530 c53c2e98 c53c2eb8 00000010 d9800510 d9800950
    2e20: 00000000 0000000
    Edited by: Edgar Liu on Oct 27, 2008 3:58 PM

    Hi,
    Can you describe your problem in more detail? And some code snippet is quite helpful to solve the problem. So far the info you provided dose not say anything
    David

  • Query update on each iteration problem (MS SQL Sever / ODBC / Native Driver

    Hello,
    I�ve been working to learn some Java and now JDBC over the past 10 or so months.
    I think I have a general understanding of how to perform queries and work with data using JDBC. However, I�ve run into a problem. I�m trying to do a query of a set of data in a database based on the value of a status column. I want to loop over the messages and perform various functions with the data then update their status in the database. It�s preferable to do these 250 to 1000 rows at a time, but no more and no less.
    I�m connecting to MS SQL Server 2000, currently with ODBC. I�ve also tried it with the Java SQL Server 2000 drivers provided by Microsoft with the same results.
    I�ve found that I can do a one table query and loop though it with a while (rs.next()) {�} and run an Update statement with executeUpdate on each iteration without any problems, no matter the number of rows returned in query.
    I have not been able to use the updateString and updateRow inside the while loop. I keep getting errors like this at the line with the updateRow():
    Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Row update failed.
    This occurs no mater how many rows I select, 1 or more.
    The real problem I�ve been having is that the query I need to loop though joins across several tables and returns some rows from some of those tables. This only seems to work when I query for 38 or less selected rows and I use an Update statement with executeUpdate on each iteration. The updateString and updateRow methods never work. Any number of rows selected greater than 38 causes a deadlock where the Update is waiting for the select to compete on the server and the Update can�t proceed until the Select is complete.
    As I stated above I�ve tried both ODBC and the native SQL Server driver with the same results. I have not tried any other databases, but that�s moot as my data is already in MS SQL.
    Questions:
    How can I avoid or get around this 38 row limit without selecting each row, one at a time?
    What am I doing wrong with the updateString and updateRow?
    Is there a better approach that anyone can suggest?
    Here�s some sample code with the problem:
    import java.sql.*;
    public class db1{
         public static void main(String[] args) throws Exception{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              String url = "jdbc:odbc:eBrochure_live";
              Connection con = DriverManager.getConnection(url, "sa", "d3v3l0p");
              Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
              Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://dcm613u2\\dcm613u2_dev:1433", "sa", "d3v3l0p");
              Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
              Statement stmt2 = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
              stmt.executeUpdate("USE [myDatabase]");
              stmt2.executeUpdate("USE [myDatabase]");
              String qGetMessages = "SELECT TOP 250 t1.messageUUID, t1.subjectHeader, t2.emailAddress as toAddress " +
              "FROM APP_Messages as t1 JOIN APP_addressBook_contacts as t2 " +
              "     On t1.toContactID = t2.contactID " +
              "WHERE t1.statusID = 'queued'";
              ResultSet rs = stmt.executeQuery(qGetMessages);
              while (rs.next()) {
                   String messageUUID = rs.getString("messageUUID");
                   String subjectHeader = rs.getString("subjectHeader");
                   System.out.println(messageUUID + " " + subjectHeader);
                   String updateString = "UPDATE APP_Messages " +
                        "SET statusID = 'sent' " +
                        "WHERE messageUUID = '" + messageUUID + "' ";
                   stmt2.executeUpdate(updateString);
              con.close();
    Thanks for the help,
    Doug Hughes

    // sorry, ps.close() should be outside of if condition
    String sql = "UPDATE APP_Messages SET statusID = 'sent' WHERE messageUUID = ?";
    Statement statement = con.createStatement();
    PreparedStatement ps = con.prepareStatement(sql);
    ResultSet rs = statement.executeQuery("your select SQL");
    if ( rs.next() )
    ps.clearParameters();
    ps.setString(1, rs.getString("your column name"));
    ps.executeUpdate();
    ps.close();
    rs.close();
    statement.close();

  • What is difference between Iterator and Collection Wrapper?

    Hi all,
                  I dont understand the actual difference between Iterator and Collection Wrapper. I observed both are used for the same purpose. Could any one please let me know when to use Collection Wrapper and when to use Iterator??
    Thanks,
    Chinnu.

    L_Kiryl is right.
    Collections support global iteration (through collection->get_next( )) and local iteration (through iterator->get_next( )).
    Each collection has a focus object. Initially, the first object has the focus.
    Any global iteration moves the focus, which is published by the event FOCUS_CHANGED of the collection.
    If you want to iterate on the collection without moving the focus (and without triggering timeconsuming follow-up processes) you can use local iteration. To do so, request an iterator object from the collection and use this to iterate.
    And one more advantage of using iterator: it takes care of deleted entities. If you use global iteration then when you reach deleted entity it will be an exception. But there is no exception with iterator in the same situation.

  • How to handle exception CX_SY_REF_IS_INITIAL

    hi experts,
    im working on a test scenario for abap mapping in SAP XI im getting this error
    An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause Dereferencing of the NULL reference
    i understand that i need to catch this exception in the abap coding but i'm not familiar with oops concepts
    can any one please suggest me how to handle this exception for the following code...
    method IF_MAPPING~EXECUTE.
      break x1149.
    * initialize iXML
      TYPE-POOLS: ixml.
      class cl_ixml definition load.
    ** Instances & Variable declaration =======================
    * instance main factory
      TYPES: BEGIN OF t_xml_line,
              data(256) TYPE x,
            END OF t_xml_line.
      DATA: l_ixml TYPE REF TO if_ixml,
    * instance input stream factory
       l_streamfactory TYPE REF TO if_ixml_stream_factory,
    * instance input stream
      l_istream  TYPE REF TO if_ixml_istream,
    * instance input document
      l_document TYPE REF TO if_ixml_document,
    * instance parse input document
      l_parser TYPE REF TO if_ixml_parser,
    * instance for elements within the nodes
      node      TYPE REF TO if_ixml_node,
    *instance of nodemap
      nodemap   TYPE REF TO if_ixml_named_node_map,
    * instance for iterator
      iterator  TYPE REF TO if_ixml_node_iterator,
      name      TYPE string,
      value     TYPE string,
    * instance main factory
       o_ixml   TYPE REF TO if_ixml,
    * instance output document
       o_document TYPE REF TO if_ixml_document,
    * instance output stream
      o_istream  TYPE REF TO if_ixml_ostream,
    * instance parse output document
      o_parser  TYPE REF TO if_ixml_parser,
    * instance fot renderer
      renderer type ref to if_ixml_renderer,
      irc type i,
      l_xml_size   TYPE i,
    *ROOT ELEMENT
    l_element_MT_DEMANDTEC_COST TYPE REF TO if_ixml_element,
    *NEXT CHILD ELEMENT FROM THE ABOVE PARENT
    l_element_DT_DEMANDTEC TYPE REF TO if_ixml_element,
    *CHILDREN1 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_WHSE  TYPE REF TO if_ixml_element,
    *CHILDREN2 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_DC    TYPE REF TO if_ixml_element,
    *CHILDREN3 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_PLANT    TYPE REF TO if_ixml_element,
    *CHILDREN4 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_QTY    TYPE REF TO if_ixml_element.
    *saving the xml document
      DATA: l_xml_table       TYPE TABLE OF t_xml_line.
      types: begin of t_source,
              whse(5),
              dc(4) ,
              plant(4),
              qty    type i,
             end of t_source.
      types: tt_source TYPE STANDARD TABLE OF t_source.
      data:  wa_source type t_source.
      data: it_source TYPE  tt_source,
            ivalue type string.
    * Procedures and business logic =======================================
    *   Creating the main iXML factory
      l_ixml = cl_ixml=>create( ).
    *   Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    * create input stream
      l_istream = l_streamfactory->create_istream_xstring( source ).
    *  initialize input document
      l_document = l_ixml->create_document( ).
    *  Create a Parser
      l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                          istream        = l_istream
                                          document       = l_document ).
    * parse input document
      l_parser->parse( ).
    *   Validate a document
      l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    *   Parse the stream
      IF l_parser->parse( ) NE 0.
        IF l_parser->num_errors( ) NE 0.
          DATA: parseerror TYPE REF TO if_ixml_parse_error,
                str        TYPE string,
                i          TYPE i,
                count      TYPE i,
                index      TYPE i.
          count = l_parser->num_errors( ).
          WRITE: count, ' parse errors have occured:'.
          index = 0.
          WHILE index < count.
            parseerror = l_parser->get_error( index = index ).
            i = parseerror->get_line( ).
            WRITE: 'line: ', i.
            i = parseerror->get_column( ).
            WRITE: 'column: ', i.
            str = parseerror->get_reason( ).
            WRITE: str.
            index = index + 1.
          ENDWHILE.
        ENDIF.
      ENDIF.
    *   Process the document
      IF l_parser->is_dom_generating( ) EQ 'X'.
        refresh : it_source.
        node ?= l_document.
        CHECK NOT node IS INITIAL.
    *   create a node iterator
        iterator  = node->create_iterator( ).
    *   get current node
        node = iterator->get_next( ).
    *   loop over all nodes
        WHILE NOT node IS INITIAL.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
    *         element node
              name    = node->get_name( ).
              nodemap = node->get_attributes( ).
            WHEN if_ixml_node=>co_node_text.
    *         text node
              value  = node->get_value( ).
              if name eq 'DT_WHSE'.
                wa_source-whse = value.
              ELSEIF name eq 'DT_DC'.
                wa_source-DC = value.
              ELSEIF name eq 'DT_PLANT'.
                wa_source-PLANT = value.
              ELSEIF name eq 'DT_QTY'.
                wa_source-QTY = value.
                COLLECT wa_source INto it_source.
                CLEAR   wa_source.
              ENDIF.
          endcase.
          node = iterator->get_next( ).
        endwhile.
      ENDIF.
      loop at it_source into wa_source .
        at first.
    *       Creating a ixml factory
          o_ixml = cl_ixml=>create( ).
    *       Creating the dom object model
          o_document = l_ixml->create_document( ).
        endat.
    *       Build and Fill  root node MT_DEMANDTEC_COST
        AT FIRST.
          l_element_MT_DEMANDTEC_COST    =
    O_document->create_simple_element(
                                  name   = 'MT_DEMANDTEC_COST'
                                  parent = o_document ).
        ENDAT.
    *      Build and Fill  Child node DT_DEMANDTEC for parent
    *                                                  MT_DEMANDTEC_COST
        l_element_DT_DEMANDTEC    = O_document->create_simple_element(
                                     name   = 'DT_DEMANDTEC'
                                     parent = l_element_MT_DEMANDTEC_COST ).
    *      Build and Fill  Child node1 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-WHSE.
        l_element_DT_WHSE    = O_document->create_simple_element(
                                         name   = 'DT_WHSE'
                                         VALUE  = ivalue
                                         parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node2 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-DC.
        l_element_DT_DC   = O_document->create_simple_element(
                                             name   = 'DT_DC'
                                              VALUE  = ivalue
                                    parent = l_element_DT_DEMANDTEC ).
    *      Build and Fill  Child node3 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-PLANT.
        l_element_DT_PLANT   = O_document->create_simple_element(
                                                 name   = 'DT_PLANT'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node4 DT_QTY for parent DT_DEMANDTEC
        ivalue              = wa_source-QTY.
        l_element_DT_QTY     = O_document->create_simple_element(
                                                 name   = 'DT_QTY'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
      endloop.
    * render document ======================================================
    * create output stream
      o_istream  = l_streamfactory->create_ostream_xstring( result ).
    *   Connect internal XML table to stream factory
      o_istream  = l_streamfactory->create_ostream_itable( table =
    l_xml_table ).
      renderer = o_ixml->create_renderer( ostream = o_istream
                                              document = o_document ).
      irc = renderer->render( ).
    * how do i catch the exception for type CX_SY_REF_IS_INITIAL ...?
    endmethod.
    full reward points for answers.
    Thanks & Regards,
    Uday Kumar.
    Edited by: UDAY on May 6, 2008 9:32 PM

    Hi Uday,
    Its occurs because you're trying to access a objects with null reference. Or you forgot to create an instance or an error occurs during the instance creation. So You should put all your "Procedures and business logic" inside a Try/catch block. as follow.
    " Define a class exception object to get error message......
    DATA o_exception TYPE REF TO cx_sy_ref_is_initial.
    "// Use the statment Try block to catch the error.
    TRY.
    *   Creating the main iXML factory
      l_ixml = cl_ixml=>create( ).
    *   Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    * create input stream
      l_istream = l_streamfactory->create_istream_xstring( source ).
    *  initialize input document
      l_document = l_ixml->create_document( ).
    *  Create a Parser
      l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                          istream        = l_istream
                                          document       = l_document ).
    * parse input document
      l_parser->parse( ).
    *   Validate a document
      l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    *   Parse the stream
      IF l_parser->parse( ) NE 0.
        IF l_parser->num_errors( ) NE 0.
          DATA: parseerror TYPE REF TO if_ixml_parse_error,
                str        TYPE string,
                i          TYPE i,
                count      TYPE i,
                index      TYPE i.
          count = l_parser->num_errors( ).
          WRITE: count, ' parse errors have occured:'.
          index = 0.
          WHILE index < count.
            parseerror = l_parser->get_error( index = index ).
            i = parseerror->get_line( ).
            WRITE: 'line: ', i.
            i = parseerror->get_column( ).
            WRITE: 'column: ', i.
            str = parseerror->get_reason( ).
            WRITE: str.
            index = index + 1.
          ENDWHILE.
        ENDIF.
      ENDIF.
    *   Process the document
      IF l_parser->is_dom_generating( ) EQ 'X'.
        refresh : it_source.
        node ?= l_document.
        CHECK NOT node IS INITIAL.
    *   create a node iterator
        iterator  = node->create_iterator( ).
    *   get current node
        node = iterator->get_next( ).
    *   loop over all nodes
        WHILE NOT node IS INITIAL.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
    *         element node
              name    = node->get_name( ).
              nodemap = node->get_attributes( ).
            WHEN if_ixml_node=>co_node_text.
    *         text node
              value  = node->get_value( ).
              if name eq 'DT_WHSE'.
                wa_source-whse = value.
              ELSEIF name eq 'DT_DC'.
                wa_source-DC = value.
              ELSEIF name eq 'DT_PLANT'.
                wa_source-PLANT = value.
              ELSEIF name eq 'DT_QTY'.
                wa_source-QTY = value.
                COLLECT wa_source INto it_source.
                CLEAR   wa_source.
              ENDIF.
          endcase.
          node = iterator->get_next( ).
        endwhile.
      ENDIF.
      loop at it_source into wa_source .
        at first.
    *       Creating a ixml factory
          o_ixml = cl_ixml=>create( ).
    *       Creating the dom object model
          o_document = l_ixml->create_document( ).
        endat.
    *       Build and Fill  root node MT_DEMANDTEC_COST
        AT FIRST.
          l_element_MT_DEMANDTEC_COST    =
    O_document->create_simple_element(
                                  name   = 'MT_DEMANDTEC_COST'
                                  parent = o_document ).
        ENDAT.
    *      Build and Fill  Child node DT_DEMANDTEC for parent
    *                                                  MT_DEMANDTEC_COST
        l_element_DT_DEMANDTEC    = O_document->create_simple_element(
                                     name   = 'DT_DEMANDTEC'
                                     parent = l_element_MT_DEMANDTEC_COST ).
    *      Build and Fill  Child node1 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-WHSE.
        l_element_DT_WHSE    = O_document->create_simple_element(
                                         name   = 'DT_WHSE'
                                         VALUE  = ivalue
                                         parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node2 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-DC.
        l_element_DT_DC   = O_document->create_simple_element(
                                             name   = 'DT_DC'
                                              VALUE  = ivalue
                                    parent = l_element_DT_DEMANDTEC ).
    *      Build and Fill  Child node3 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-PLANT.
        l_element_DT_PLANT   = O_document->create_simple_element(
                                                 name   = 'DT_PLANT'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node4 DT_QTY for parent DT_DEMANDTEC
        ivalue              = wa_source-QTY.
        l_element_DT_QTY     = O_document->create_simple_element(
                                                 name   = 'DT_QTY'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
      endloop.
    * render document ======================================================
    * create output stream
      o_istream  = l_streamfactory->create_ostream_xstring( result ).
    *   Connect internal XML table to stream factory
      o_istream  = l_streamfactory->create_ostream_itable( table =
    l_xml_table ).
      renderer = o_ixml->create_renderer( ostream = o_istream
                                              document = o_document ).
      irc = renderer->render( ).
    "   The Statement CATCH define a block that catches the exceptions of the
    "   exception class cx_sy_ref_is_initial
        CATCH cx_sy_ref_is_initial INTO o_exception.
    " If you need to get the error message text do as follow
    DATA errorMsg type string.
    " Get the message text
      errorMsg = o_exception->GET_TEXT( ).
    " Display the error information
      MESSAGE errorMsg TYPE 'I'.
      ENDTRY.
    The TRY block defines a guarded area whose class-based exceptions can be caught in the subsequent CATCH blocks. If no exception occurs in the TRY block and it reaches its end, the system continues the processing after ENDTRY. If a class-based exception occurs in the TRY block, the system searches for an exception handler in the same or an external TRY control structure.
    Font: SAP Help
    You can see a how to create and use an exception in this example [ ABAP Objects - Defining a Class-based exceptions|https://wiki.sdn.sap.com/wiki/x/19w] .
    Best Regards.
    Marcelo Ramos

  • Thread unserialized exception: NotSerializableException: java.lang.Thread

    hello experts,
    i have this exception coming; seems to be coming from some thread but i removed all the threads from my code, i thought its because of some object which is still unserialized, i am not sure whether this is because of one unserialized object or its because of more reasons, please have a look:
    Exception in client main: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Thread
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Thread
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
         at BallServerImpl_Stub.getAllBallProxies(Unknown Source)
         at CopyOfManyMovingBalls.<init>(CopyOfManyMovingBalls.java:80)
         at CopyOfManyMovingBalls$2.run(CopyOfManyMovingBalls.java:294)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: java.lang.Thread
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
         ... 11 more
    this is coming  when i m accessing this method:
    class BallServerImpl extends UnicastRemoteObject
    implements BallServer
    * @return an enumeration of all Balls as proxy objects
    public Ball[] getAllBallProxies() throws java.rmi.RemoteException
         Ball[] locations1 = new Ball[hash.size()];
    java.util.Enumeration iter = hash.elements();
    int idx = 0;
    while (iter.hasMoreElements())
         BallImpl impl = (BallImpl)iter.nextElement();
    locations1[idx++] = new BallProxy(impl);
    return locations1;
    why this function is running fine when i m calling this from client unlike getAllBallProxies() nevertheless both are returning the same thing:
    * @return an enumeration of all Balls as remote references
    public Ball[] getAllBalls()
         Ball[] locations = new Ball[hash.size()];
    java.util.Enumeration iter = hash.elements();
    int idx = 0;
    while (iter.hasMoreElements())
    locations[idx++] = (Ball)iter.nextElement();
    return locations;
    the proxy Class:
    * The Proxybouncing ball.
    public class BallProxy implements Serializable,Ball {
    * The Real bouncing ball.
    public class BallImpl extends UnicastRemoteObject implements IBallRemote,Serializable
    *load of thanks as this is "SHOW STOPPER",
    jibbylala*
    Edited by: 805185 on Oct 25, 2010 8:33 PM
    Edited by: 805185 on Oct 25, 2010 8:39 PM
    Edited by: 805185 on Oct 25, 2010 9:21 PM
    Edited by: 805185 on Oct 25, 2010 9:25 PM
    Edited by: 805185 on Oct 25, 2010 9:27 PM
    Edited by: 805185 on Oct 25, 2010 9:46 PM

    that there was some thread there in BallProxy but i removed all from them and now testingIf you don't post the code people ask to see, you may never get a useful answer here.
    P.S i didn't know that threads are not SerializedThe Thread class is not Serializable. Precision please.
    Now i m updating the code, i needed the confirmationConfirmation of what?
    and now trying to avoid them.Them?
    But what if i need them.Them?
    Please make the effort to express yourself clearly. You've already been told you're not making much sense and you haven't done anything about it.
    how can we make serialized?The concept of serializing a Thread makes no sense whatsoever. You don't want to do it. You don't need to do it. You can't do it. It wouldn't work if you could do it.
    Somewhere or other you have a class member that is a reference to a Thread. Remove it or make it transient. If you post the code somebody may help you. If you don't, nobody can possibly do that.

Maybe you are looking for

  • Error in DTP (The master data is deleted in the Background)

    Hi, while loading the data  to Data target (0chrt_acct_attr) through DTP...... I got the Error "  The master data is deleted in the Background". Plz advice me it is an urgent issue.

  • Multiple File Folders in PI 7.1

    Hi Experts I am working on a file to File configuration scenario, I wanted to used only one sender and Receiver CC to pick up the files from different folders and drop it in the corresponding folders, Can anyone send the link to the blog or details h

  • Additional error handling within a production application using SQLERRM

    I have an application that is already in production. What I would like to do is to add additional error detail currently captured within the SQLERRM. I would like to capture detail such as: where the error occurred ie. what procedure in which package

  • Mail / iPhoto Photo Browser out of date.

    In Mail, a photo browser button allows me to browse the contents of my iPhoto library (Events, places, etc). However, the contents are not the same as what I see in iPhoto.  They appear to be out of date - no event or photo after Jan 2011 is present.

  • Signature field scrolls offscreen

    When I try to update my signature, the field scrolls most of the way off the screen - just 2 lines or so showing.  Anyone else experiencing this?  I'm on a new iPhone 4s migrated from a 3s.