MapViewer API: addMapCacheTheme creates unexpected XML request string

Hi,
I try to get a map with map cache theme on it. But MapViewer class generates an xml request string in which an unexpected wfs theme
exists. So I'm unable to add a map cache theme since the wfs theme causes a problem and i only get an image painted with background
color...
my java code is as follows:
               String viewerUrl = "http://localhost:8888/mapviewer/omserver";
               String dataSource = "ADATASOURCE";
               String mapCache= "AMAPCACHE";
               MapViewer viewer = new MapViewer(viewerUrl);
               viewer.setDataSourceName(dataSource);
               viewer.setImageFormat(MapViewer.FORMAT_PNG_URL);
               viewer.setMapRequestSRID(8307);
               viewer.setAntiAliasing(false);
               viewer.setMapTitle(null);
               viewer.setBackgroundColor(new Color(0xA6CAF0));
               viewer.setBackgroundImageURL(null);
               viewer.setDeviceSize(new Dimension(480, 480));
               //viewer.setBaseMapName(baseMap);
               viewer.addMapCacheTheme(mapCache, dataSource, mapCache, true);
               viewer.setCenter(29, 41);
               viewer.setSize(1);
               //For debugging issues
               String req = viewer.getMapRequestString();
               viewer.run();
value for req variable is:
<?xml version="1.0" standalone="yes"?>
<map_request
datasource="ADATASOURCE"
srid="8307"
width="480"
height="480"
bgcolor="#a6caf0"
antialiase="false"
format="PNG_URL"
>
<center size="1.0">
<geoFeature>
<geometricProperty typeName="center">
<Point>
<coordinates>29.0,41.0</coordinates>
</Point>
</geometricProperty>
</geoFeature>
</center>
<themes>
<theme name="AMAPCACHE" datasource="ADATASOURCE">
<map_cache_theme map_cache_name="AMAPCACHE" snap_to_cache_scale="true"/> </theme> <theme name="AMAPCACHE" >
<wfs_feature_request
datasource="ADATASOURCE"
/>
</theme>
</themes>
</map_request>
The first theme is the one that i wanted to add.
The second one (bold) is the one that causes trouble. I don't know where it comes from.
This problem occured when i started to use mvclient.jar that came with patch 6453515 which changed MapViewer version from
Ver10131_B06102 to Ver11_B07100.
The old mvclient.jar (came with MapViewer Ver10131_B06102) produces the following xml request string:
<?xml version="1.0" standalone="yes"?>
<map_request
datasource="ADATASOURCE"
srid="8307"
width="480"
height="480"
bgcolor="#a6caf0"
antialiase="false"
format="PNG_URL"
>
<center size="1.0">
<geoFeature>
<geometricProperty typeName="center">
<Point>
<coordinates>29.0,41.0</coordinates>
</Point>
</geometricProperty>
</geoFeature>
</center>
<themes>
<theme name="AMAPCACHE" datasource="ADATASOURCE">
<map_cache_theme map_cache_name="AMAPCACHE" snap_to_cache_scale="true"/> </theme> </themes>
</map_request>
What might cause this problem?
OS: Windows XP Pro SP2
IDE: JDeveloper 10.1.3.1.0
Thanks in advance,
Cihan

Hi Cihan,
it is confirmed to be a bug with this client library and it will be fixed. Thanks.
Joao

Similar Messages

  • Creating dynamic XML without String var ?

    Hi all...
    I am trying to create a XML to use it in a DataGrid as a
    DataProvider... So far I was able to do it but only using a String
    variable, is there any othe way to do it? I found/think there is
    another way but i'm kinda lost on this subject... Here is how im
    doing it (more or less):
    private var dataPlaylist : XML;
    private var xml : String = new String();
    xml += ' <music>\n';
    xml += ' <artist>' + player.id3.artist +
    '</artist>\n';
    xml += ' <track>' + player.id3.songName +
    '</track>\n';
    xml += ' <title>' + player.id3.title +
    '</title>\n';
    xml += ' <album>' + player.id3.album +
    '</album>\n';
    xml += ' <time>' + player.length + '</time>\n';
    xml += ' </music>\n';
    dataPlaylist = XML(xml);
    playlist.dataProvider = dataPlaylist.musica;

    It's better to read the entire XML documentation located one
    level up:
    http://livedocs.macromedia.com/flex/2/docs/00001910.html
    For your case, you can actually do this:
    dataPlayList: XML =
    <music>
    <artist>{player.id3.artist}</artist>
    <track>{player.id3.songName}</track>
    </music>;
    Note the use of curly braces {} to embed variables inside
    your XML. There's a lot more you can do with XML as well. It's in
    the docs.

  • How to use tcRequestOperationsIntf API to create a self-request?

    According to documentation, I can use tcRequestOperationsIntf API methods to create and manage requests.
    How can I use these methods to initiate a self-request (for provisioning user a new resource)?
    Because when I create a usual request, it's equivalent to direct provisioning the resource (from the user's resource profile) then all approval processes are bypassed :(

    While tcUserOperationsIntf.provisionResource would provision the resource to the user bypassing the approval, tcRequestOperationsIntf can be used to raise a request to provision a user with a resource along with approval, if approval is defined for that resource in the approval process.
    Here is a sample code for raising a request to provision user (lUserKey) with resource object (lObjectKey)
    ///Created the request object for provisioning the RO
    requestObj = (tcRequestOperationsIntf) utilFactory.getUtility("Thor.API.Operations.tcRequestOperationsIntf");
    HashMap reqMap = new HashMap();
    reqMap.put("Requests.Target Type", "U");
    reqMap.put("Requests.Object Request Type", "Add");
    reqMap.put("Requests.Type", "U");
    lRequestKey = requestObj.createRequest(reqMap);
    //Adding user to be provisioned for
    requestObj.addRequestUser(lRequestKey, lUserKey);
    //Adding object to be provisioned
    requestObj.addRequestObject(lRequestKey, lObjectKey);
    //create the request
    requestObj.completeRequestCreation(lRequestKey);
    Hope it helps,
    Rgds, Ajay

  • Creating a Function module to send XML Byte String

    Hi all,
    I have to create a Function module to get XML byte string.The internal table is dynamic coloums based on how many data selected as a importparameter.from the internal; table data I have to create a XML byte string as a output.Pl help me to proceed further.
    Thanks in Advance.
    Ram

    If i have your question right you need to convert an internal table of unknown type to an xml string then to a byte string.
    data xmlString type string.
    data xmlXString type xstring.
    call transformation id
       source
          table = internalTableYouWantToExport
       result
          xml xmlString.
    export xmlString to data buffer xmlXString.
    xmlString has the xml of the table and xmlXString contains the byte representation of the string.

  • How to post xml - request in mapviewer

    Hello,
    i want to make a web page that will post xml - requests in mapviewer.
    How can i send a xml request in mapviwer from a web page?

    Does the mapviewer welcome do what you need?
    That is index.html in oc4jhome/j2ee/home/applications/mapviewer/web/
    If it does then , use the same method to submit a form using HTTP POST to
    the mapviewer servlet.
    It's also documented in Ch 3 of the the user guide.
    "A request to the OracleAS MapViewer servlet has the following format:
    http://hostname[:port]/MapViewer-servlet-path?xml_request=xml-request
    Jayant

  • Creating new xml document

    Hi
    there are many samples about reading results into xml, but how can the oracle xml parser be used to create a xml document (String) from the scratch?
    Thanks a lot for suggestions
    Daniel

    Thanks , but i know all this !
    File corFile = new File("e:\\corFile.xml");
    DOMParser dp=new DOMParser();
    InputStream is = new FileInputStream(corFile);
    XMLDocument root=XMLHelper.parse(is,null);
    is.close();
    Element hello = root.createElement("hello");
    Text bonjour = root.createTextNode("Bonjour");
    hello.appendChild(bonjour);
    root.appendChild(hello);
    i know how i can update the XMLDocument ,
    but how i can update my file corFile.xml ??
    i would create a new xml file from my new XMLDocument !

  • Define the User/Passwort for a XML request ProcessInstanceStateChanged

    Hi,
    I created a workflow which starts another workflow on a remote system via web activity "start workflow" function and then waits till the workflow on the remote system is processed and calls back to the original system.
    In the original system I can define which user and password is used for the xml communication to the remote system, which works fine. SWXML show the XML messages on both systems and the worklow is started by the specified user.
    When the Workflow in the remote system is processed the system creates a XML request ProcessInstanceStateChanged
    to inform the calling system that the process is done and it can go on with the workflow there, but this XML document just seems to get lost. The SWXML shows no status for the document in the remote system and there is no entry for this document in the original system.
    The documentation says that I have to specify the users for which XML requests are accepted. But there is no information how I can configure the workflow in the remote system to use a special user and password for that. Can anyone tell me where to configure this? (currently the xml is send via wf-batch user which cannot work due to the genereted password etc.).
    Thanks in advance
    Roman

    From the little information available here I can suggest following:
    1.     Check the Account validity and authorizations of the User used for authentication from DOT NET. If possible, assign SAP_ALL in Development and repeat tests. Later we can narrow down the access easily.
    2.     There is a known Kernel issue with ICF logon message handling, described in SAP Note 1241566 - Set of corrections: Logging on 1/2008. Check if the recommended Kernel patch level is already applied.
    If none of the above helps, please send me the following:
    1.     Trace file for the work process 0 in transaction ST11 on the application server spsisd_ISD_00
    2.     Generate trace files with the highest trace level (3) as per SAP Note: 507994 - Generating plug-in trace files for troubleshooting and send it over.
    We can look at various Kernel and Service level calls from trace files which should help us identify the root cause.

  • oms_error Message:[oms] empty or null xml map request string.

    I'm using mapviewer. I create a stored procedure in oracle that uses the utl_http package to make the map request. The omserver response with an error but when i make a map request via internet explorer the server response its ok and show me the correspondent map. This is my pl/sql code it fails in this line:
    UTL_HTTP.SET_HEADER(l_http_req, 'Content-Type', 'application/x-www-form-urlencoded');
         UTL_HTTP.SET_HEADER(l_http_req, 'Content-Lenght', LENGTH(map_request));
         UTL_HTTP.SET_HEADER(l_http_req, 'Host', 'cobogis09');
         UTL_HTTP.SET_HEADER(l_http_req, 'Port', '8888');
    As you can see it tells to me that the map request string is empty but im sending the map request in the next way:
         UTL_HTTP.WRITE_TEXT(l_http_req, '<?xml version="1.0" encoding="UTF-8"?><map_request datasource="stream" srid="8307" basemap="" width="960" height="768" antialiasing="false" format="GIF_URL" title="Demonstration"></map_request>');
         l_http_resp := utl_http.get_response(l_http_req);
         utl_http.read_text(l_http_resp, l_value);
         response := sys.XMLTYPE.createxml(l_value);
         utl_http.end_response(l_http_resp);
         img_url := response.EXTRACT('/map_response/map_image/map_content/@url').getstringval();
    img_url := response.EXTRACT('/map_response/map_image/map_content/@url').getstringval();
    obviously because the server response its not ok
    the server response is (i get this message in my l_value variable):
    <?xml version="1.0" encoding="UTF-8"?><oms_error>Message:[oms] empty or null xml map request string.
    Tue Jul 25 10:37:43 GMT-05:00 2006
    Severity: 0
    Description:
         at oracle.lbs.mapserver.oms.getXMLDocument(oms.java:860)
         at oracle.lbs.mapserver.oms.doPost(oms.java:303)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:595)
    </oms_error>
    What i want to know its why the server says that the map request string is empty. As you can see the map request is not empty, but when i send to the server something happens that sends this map request string empty to the server.
    The next is the console of the omserver:
    C:\oc4j_extended>cd\
    C:\>cd C:\oc4j_extended\j2ee\home
    C:\oc4j_extended\j2ee\home>java -hotspot -Xmx512M -jar oc4j.jar
    06/07/25 11:00:49 INFO [oracle.lbs.mapserver.oms] oms root path: C:\oc4j_extended\j2ee\home\lbs\mapviewer\web\
    06/07/25 11:00:49 Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) initialized
    06/07/25 11:00:49 INFO [oracle.lbs.mapserver.core.MapperConfig] using default config file: C:\oc4j_extended\j2ee\home\lbs\mapviewer\web\WEB-INF\conf\mapViewerConfig.xml
    06/07/25 11:00:49 WARN [oracle.lbs.mapserver.core.MapperPool] destroying ALL mapmaker instances.
    06/07/25 11:00:50 INFO [oracle.lbs.mapserver.core.MapperConfig] setting logging level to finest
    06/07/25 11:00:50 Tue Jul 25 11:00:50 GMT-05:00 2006 INFO [oracle.sdovis.CacheMgr2] In memory cache limit set to: 512MB
    06/07/25 11:00:50 Tue Jul 25 11:00:50 GMT-05:00 2006 INFO [oracle.lbs.mapserver.core.MapperConfig] Disk-based cache is no longer supported.
    06/07/25 11:00:50 Tue Jul 25 11:00:50 GMT-05:00 2006 INFO [oracle.lbs.mapserver.core.MapperConfig] setting proxy to: coboisa01.ag.ad.local:8080
    06/07/25 11:00:50 Tue Jul 25 11:00:50 GMT-05:00 2006 FINEST [oracle.lbs.mapserver.core.MapperConfig]
    Allowed IPs:
    Excluded IPs:
    06/07/25 11:00:50 Tue Jul 25 11:00:50 GMT-05:00 2006 ERROR [oracle.lbs.mapserver.core.MapperConfig] ###### [MapperConfig] clear-text passwords in the mapViewrConfig.xml file must be prefixed with a '!' (exclamation mark).
    06/07/25 11:00:50 Tue Jul 25 11:00:50 GMT-05:00 2006 INFO [oracle.lbs.mapserver.core.MapperConfig] Map Recycling thread started.
    06/07/25 11:00:50 Tue Jul 25 11:00:50 GMT-05:00 2006 INFO [oracle.lbs.mapserver.oms] *** Oracle MapViewer started. ***
    06/07/25 11:01:03 Tue Jul 25 11:01:03 GMT-05:00 2006 FINEST [oracle.lbs.mapserver.oms] request.getRemoteUser = jazn.com/admin
    06/07/25 11:01:03 Tue Jul 25 11:01:03 GMT-05:00 2006 FINEST [oracle.lbs.mapserver.oms] request= <?xml version="1.0" standalone="yes"?>
    <non_map_request>
    <add_data_source name="stream"
    jdbc_host="cobodata01"
    jdbc_sid="stream"
    jdbc_port="1521"
    jdbc_user="***"
    jdbc_password="***"
    jdbc_mode="thin"
    number_of_mappers="3"/>
    </non_map_request>
    06/07/25 11:01:03 Tue Jul 25 11:01:03 GMT-05:00 2006 FINEST [oracle.lbs.mapserver.oms] getRequestType: nodeName=add_data_source
    06/07/25 11:01:03 Tue Jul 25 11:01:03 GMT-05:00 2006 INFO [oracle.lbs.mapserver.MapServerImpl] adding a map data src [name=stream]
    06/07/25 11:01:05 Tue Jul 25 11:01:05 GMT-05:00 2006 FINEST [oracle.sdovis.SRS] loaded 748 geodetic srids.
    06/07/25 11:01:05 Tue Jul 25 11:01:05 GMT-05:00 2006 INFO [oracle.sdovis.CacheMgr2] Spatial Data Cache opened. Region=SDOVIS_DATA.
    06/07/25 11:01:05 Tue Jul 25 11:01:05 GMT-05:00 2006 INFO [oracle.sdovis.CacheMgr2] max_cache_size=512 MB.
    06/07/25 11:01:05 Tue Jul 25 11:01:05 GMT-05:00 2006 INFO [oracle.sdovis.CacheMgr2] sub region sdovis_subreg_gis_jdbc:oracle:thin:@cobodata01:1521:stream created in cache.
    06/07/25 11:01:05 Tue Jul 25 11:01:05 GMT-05:00 2006 INFO [oracle.lbs.mapserver.core.MapperPool] added a mapper instance to the pool [data src=stream]
    06/07/25 11:01:05 Tue Jul 25 11:01:05 GMT-05:00 2006 INFO [oracle.lbs.mapserver.core.MapperPool] added a mapper instance to the pool [data src=stream]
    06/07/25 11:01:06 Tue Jul 25 11:01:06 GMT-05:00 2006 INFO [oracle.lbs.mapserver.core.MapperPool] added a mapper instance to the pool [data src=stream]
    06/07/25 11:01:36 Tue Jul 25 11:01:36 GMT-05:00 2006 FINEST [oracle.lbs.mapserver.oms] request.getRemoteUser = null
    06/07/25 11:01:36 Tue Jul 25 11:01:36 GMT-05:00 2006 FINEST [oracle.lbs.mapserver.oms] request= null
    As you can see the arrive empty to the server, what can be wrong

    Hi,
    in this map request, it looks that the basemap string is empty.
    UTL_HTTP.WRITE_TEXT(l_http_req, '<?xml version="1.0" encoding="UTF-8"?><map_request datasource="stream" srid="8307" basemap="" width="960" height="768" antialiasing="false" format="GIF_URL" title="Demonstration"></map_request>');

  • XML document - request string

    Hi Experts,
    Could you please tell me, how to pass XML document as a request string to the webservice scenario. Inside the service, I have to do the schema validation for the request . Please guide me, how to proceed further?
    Regards
    Sara

    Hi SARA,
    use following Code written in SAX parsing .this will fulfil your requirment.This handle Special character also.
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    import java.io.Writer;
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    import javax.xml.parsers.FactoryConfigurationError;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.SAXException;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    public class SimpleForwardMappingString extends DefaultHandler implements StreamTransformation
         private List m_arlCurrent = new ArrayList();
         private List m_arlBOList = new ArrayList();
         private List m_arlObjectList = new ArrayList();
        public static int counter = 0;
         String listName = "newList";
         public  StringBuffer m_totalElementsBuffer = new StringBuffer();
         String startData = "<inCanonStream>";
         String endData = "</inCanonStream>";
         private Map param = null;
         /** Constant Strings used in Forward Mapping */
         public static void main(String args[])
              try {
                      InputStream in = new FileInputStream(new File("C:
    Documents and Settings
    281152
    Desktop
    Cannonical12321.xml"));
                   OutputStream out = new FileOutputStream(new File("C:
    Documents and Settings
    281152
    Desktop
    Cannonical21.xmlOut.xml"));               
                   SimpleForwardMappingString myMapping = new SimpleForwardMappingString();
              catch (Exception e)
                   e.printStackTrace();
         public void execute(InputStream arg0, OutputStream arg1)
         throws StreamTransformationException
              Writer out;
              try
                   out = new OutputStreamWriter(arg1, "UTF16");
                   /** Building the SAX parser */
                   getXMLDoc(arg0, arg1);
                   arg1.write(m_totalElementsBuffer.toString().getBytes("UTF16"));
              catch (IOException e)
                   System.out.println("Error : io" + e.getMessage());
              catch (Exception e)
                   System.out.println("Error :" + e.getMessage());
         /* (non-Javadoc)
    @see com.sap.aii.mapping.api.StreamTransformation#setParameter(java.util.Map)
         public void setParameter(Map arg0)
         public void getXMLDoc(InputStream inputStream, OutputStream outputStream)
    Defines a factory API that enables applications to configure and
    obtain a SAX based parser to parse XML documents. Once an application
    has obtained a reference to a SAXParserFactory it can use the
    factory to configure and obtain parser instances.
              SAXParserFactory factory = SAXParserFactory.newInstance();
              try
                   factory.setNamespaceAware(true);
                   factory.setValidating(true);
                   SAXParser saxParser = factory.newSAXParser();
    Parse the content of the given {@link java.io.InputStream}
    instance as XML using the specified
    {@link org.xml.sax.helpers.DefaultHandler}.
    @param inputstream InputStream containing the content to be parsed.
    @param cobject The SAX DefaultHandler to use.
    @exception IOException If any IO errors occur.
    @exception IllegalArgumentException If the given InputStream is null.
    @exception SAXException If the underlying parser throws a
    SAXException while parsing.               
                   saxParser.parse(inputStream, this);
              catch (FactoryConfigurationError e)
                   System.out.println("Error");
              catch (ParserConfigurationException e)
                   e.printStackTrace();
              catch (SAXException e)
                   e.printStackTrace();
              catch (IOException e)
                   e.printStackTrace();
         /** ===========================================================
                             Methods Overriding in SAX Default Handler
              ===========================================================
    Receive notification of the beginning of the document.
    By overriding this method in a subclass to take specific actions
    at the beginning of a document (such as allocating the root node
    of a tree or creating an output file)     
         public void startDocument()throws SAXException
              if(m_totalElementsBuffer.length()>0)
                                m_totalElementsBuffer = new StringBuffer();
                                counter = 0;
              m_totalElementsBuffer.append(m_prologue);
              m_totalElementsBuffer.append(m_nameSpace);
              m_totalElementsBuffer.append(startData);     }
    Receive notification of the end of the document.
    By overriding this method in a subclass to take specific
    actions at the end of a document (such as finalising a tree
    or closing an output file)     
         public void endDocument()throws SAXException
              m_totalElementsBuffer.append(endData);
              m_totalElementsBuffer.append(m_rootElementEnd);
    Receive notification of the start of an element.
    By overriding this method in a subclass to take specific
    actions at the start of each element (such as allocating
    a new tree node or writing output to a file)
         public void startElement(String namespaceURI, String name, String qName, Attributes attrs)
              throws SAXException
              /** If current List is not empty then append node to StringBuffer */
                   m_totalElementsBuffer.append("&lt;" + name + "&gt;");
    Receive notification of the end of an element.
    By overriding this method in a subclass to take specific
    actions at the end of each element (such as finalising
    a tree node or writing output to a file)
         public void endElement(String uri, String name, String qName) throws SAXException
                   m_totalElementsBuffer.append("&lt;/" + name + "&gt;");
    Receive notification of character data inside an element.
    By overriding this method to take specific actions for each
    chunk of character data (such as adding the data to a node
    or buffer, or printing it to a file)     
         public void characters(char buf[], int offset, int len)
              throws SAXException
              String s = new String(buf, offset, len);
              if (null != s && s.length() >0)
                   if(s.equalsIgnoreCase("&"))
                         //System.out.println("FOUND AND SYMBOL");
                         String s1 = s.replaceAll("&","_-#_");
                         //System.out.println("s= " +s1);
                         s = s1;
                   if(s.equalsIgnoreCase("<"))
                         //System.out.println("FOUND AND SYMBOL");
                         String s1 = s.replaceAll("<","_#-_");
                         //System.out.println("s= " +s1);
                         s = s1;
                   m_totalElementsBuffer.append(s);
    Thanks
    Sunil Singh

  • Create a cache for external map source - Error in parsing xml request.

    When doing the following:
    Create a cache for external map source
    I get "error in parsing xml request" when setting the following
    Map service Url:
    http://neowms.sci.gsfc.nasa.gov/wms/wms?version=1.3.0&service=WMS&request=GetCapabilities
    It looks like it is breaking on "&". Any suggestions?
    Rob

    Hi Chris,
    thanks for your reply!
    I've tried to add the following into persistence.xml (although I've read that eclipseLink uses L2 cache by default..):
    <shared-cache-mode>ALL</shared-cache-mode>
    Then I replaced the Cache bean with a stateless bean which has methods like
    Genre findGenreCreateIfAbsent(String genreName){
    Genre genre = genreDAO.findByName(genreName);
    if (genre!=null){
    return genre;
    genre = //Build new genre object
    genreDAO.persist(genre);
    return genre;
    As far as I undestood, the shared cache should automatically store the genre and avoid querying the DB multiple times for the same genre, but unfortunately this is not the case: if I use a FINE logging level, I see really a lot of SELECT queries, which I didn't see with my "home made" Cache...
    I am really confused.. :(
    Thanks again for helping + bye

  • Creating self registration request using OIM API

    Hi guys,
    When we try to create a self regisrtation request using OIM API , we ge the following exception:
    We get this error when we set the following in Design console.
    Does user have to provide challenge information during registration = FALSE
    and passed an blank object in place of challenge question parameter in createSelfRegistrationRequest method in tcUtilityBaseClass.
    19:22:17,218 ERROR [REQUESTS] Error: Failed to save REQ_CONSOLIDATED_DATA_VALUE
    data for Create Entity.
    java.lang.NullPointerException
    at org.apache.xml.serializer.TreeWalker.dispatachChars(TreeWalker.java:2
    44)
    at org.apache.xml.serializer.TreeWalker.startNode(TreeWalker.java:414)
    at org.apache.xml.serializer.TreeWalker.traverse(TreeWalker.java:143)
    at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transf
    ormerIdentityImpl.java:389)
    at com.thortech.xl.dataobj.util.RequestDataConsolidator.convertNodeToXML
    (Unknown Source)
    at com.thortech.xl.dataobj.util.RequestDataConsolidator.addUser(Unknown
    Source)
    at com.thortech.xl.dataobj.tcDataBase.createRequestForCreateEntity(Unkno
    wn Source)
    at com.thortech.xl.dataobj.tcDataBase.createRegistrationRequest(Unknown
    Source)
    at com.thortech.xl.dataobj.tcDataBase.createRegistrationRequest(Unknown
    Source)
    at com.thortech.xl.ejb.beansimpl.tcUnauthenticatedOperationsBean.createR
    egistrationRequest(Unknown Source)
    at com.thortech.xl.ejb.beans.tcUnauthenticatedOperationsSession.createRe
    gistrationRequest(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
    tatelessSessionContainer.java:237)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
    ke(CachedConnectionInterceptor.java:158)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
    elessSessionInstanceInterceptor.java:169)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
    Interceptor.java:63)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
    rceptor.java:121)
    How do we create a self registration request , using OIM API , with and without challenge questions?

    Well try this piece of code. This might be similar to yours but it worked perfectly for me. For you the error might be the attribute names which you are passing, it should be the one dfined in the FormMetaData xml as below.
         import Thor.API.tcUtilityFactory;
         // define you class below
         ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
         final Hashtable env = config.getAllSettings();
         Hashtable quesAns = new Hashtable();
         HashMap user = new HashMap();
         user.put("Users.User ID", "SelfTesting");
         user.put("Users.First Name", "SelfTesting");
         user.put("Users.Last Name", "SelfTesting");
         user.put("Users.Email", "[email protected]");
         user.put("Users.Password", "SelfTesting");
         user.put("ConfirmPassword", "SelfTesting");
         tcUtilityFactory.createRegistrationRequest(env, user, quesAns);
    And for the query of challenge QnA, these are the following combinations possible:
    1) Property Does user have to provide challenge information during registration set to TRUE
    - During self-registration from web console, it will show you Challenge Questions section on the right. If you do not select any questions, it will thow you an error there itself.
    - Doing it from API will create no difference(even if you pass a blank HashTable). The request will be created successfully and on completion when the user tries to login, it will ask for Security QnA.
    2) Property Does user have to provide challenge information during registration set to FALSE
    - During self-registration from web console, it doesn't show you Challenge Questions section on the right. The request will be created successfully and on completion when the user tries to login, it will ask for Security QnA.
    - Doing it from API, you will have to pass a blank HashTable as in above code. The request will be created successfully and on completion when the user tries to login, it will ask for Security QnA.
    Hope it works.
    Thanks
    Sunny

  • How to view XML-Request sent to Mapviewer

    Hello,
    I am using the Mapviewer Javascript Api and would like to have a look at the xml request which was sent to the Mapviewer. When setting the log level to FINEST I can see the requests but not the real XML.
    All hints are welcome.

    Hi,
    You can catch this in different ways:
    - browser addons/plugins (FireBug, HTTPFox for firefox or something similar for your browser) etc;
    - if you prefer some kind of network sniffer - wireshark or similar helps;
    these are the things I usually use, someone can share other ways;
    regards, michael

  • JDBC THEME-MAPVIEWER-05517 Request string is too long for Oracle Maps' non-

    hi,
    if I need a quite complex query to be added to dynamic JDBC theme I get this error:
    [MAPVIEWER-05517] Request string is too long for Oracle Maps' non-AJAX remoting.
    -why? I am using Oracle Maps JS API so it is AJAX remoting, or not?
    -what is the limit of a JDBC theme definition?
    regards,
    Brano

    hi,
    yes, having look at MVMapView.enableXMLHTTP(true) in doc explains a lot...
    thanks,
    Brano

  • How to create an XML document from a String.

    Can anyone help,
         In the Microsoft XML Document DOM there is a load function load(string) which will create an XML document, but now we are switching to Java and I do not know how to create and XML document from a string, this string �xml document� is passed to my program from a webservice and I need to read several xml elements form it in a web server.
    This string is a well formatted XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Countries NumberOfRecords="1" LanguageID="en-us">
         <Country>
              <CountryCode>AU</CountryCode>
              <CountryName>AUSTRALIA</CountryName>
         </Country>
    </Countries>

    Thanks PC!
    I made it work using:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    factory.setIgnoringComments(true); // We want to ignore comments
    // Now use the factory to create a DOM parser
    DocumentBuilder parser = factory.newDocumentBuilder();
    //TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
    InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
    // Parse the InputStream and build the document
    Document document = parser.parse(in);
    But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code?

  • How to create new XML file using retreived XML content by using SAX API?

    hi all,
    * How to create new XML file using retreived XML content by using SAX ?
    * I have tried my level best, but output is coming invalid format, my code is follows,
    XMLFileParser.java class :-
    import java.io.StringReader;
    import java.io.StringWriter;
    import javax.xml.transform.OutputKeys;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMResult;
    import javax.xml.transform.sax.SAXSource;
    import javax.xml.transform.sax.SAXTransformerFactory;
    import javax.xml.transform.sax.TransformerHandler;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.XMLFilterImpl;
    public class PdfParser extends XMLFilterImpl {
        private TransformerHandler handler;
        Document meta_data;
        private StringWriter meta_data_text = new StringWriter();
        public void startDocument() throws SAXException {
        void startValidation() throws SAXException {
            StreamResult streamResult = new StreamResult(meta_data_text);
            SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
            try
                handler = factory.newTransformerHandler();
                Transformer transformer = handler.getTransformer();
                transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                handler.setResult(streamResult);
                handler.startDocument();
            catch (TransformerConfigurationException tce)
                System.out.println("Error during the parse :"+ tce.getMessageAndLocation());
            super.startDocument();
        public void startElement(String namespaceURI, String localName,
                String qualifiedName, Attributes atts) throws SAXException {
            handler.startElement(namespaceURI, localName, qualifiedName, atts);
            super.startElement(namespaceURI, localName, qualifiedName, atts);
        public void characters(char[] text, int start, int length)
                throws SAXException {
            handler.characters(text, start, length);
            super.characters(text, start, length);
        public void endElement(String namespaceURI, String localName,
                String qualifiedName) throws SAXException {
            super.endElement("", localName, qualifiedName);
            handler.endElement("", localName, qualifiedName);
        public void endDocument() throws SAXException {
        void endValidation() throws SAXException {
            handler.endDocument();
            try {
                TransformerFactory transfactory = TransformerFactory.newInstance();
                Transformer trans = transfactory.newTransformer();
                SAXSource sax_source = new SAXSource(new InputSource(new StringReader(meta_data_text.toString())));
                DOMResult dom_result = new DOMResult();
                trans.transform(sax_source, dom_result);
                meta_data = (Document) dom_result.getNode();
                System.out.println(meta_data_text);
            catch (TransformerConfigurationException tce) {
                System.out.println("Error occurs during the parse :"+ tce.getMessageAndLocation());
            catch (TransformerException te) {
                System.out.println("Error in result transformation :"+ te.getMessageAndLocation());
    } CreateXMLFile.java class :-
    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();
    Sax.endElement("", "basic-metadata", "basic-metadata");* In CreateXMLFile.java
    class, I have retreived the xml content in the meta_data object, after that i have converted into character array and this will be sends to SAX
    * In this case , the XML file created successfully but the retreived XML content added as an text in between basic-metadata Element, that is, retreived XML content
    is not an XML type text, it just an Normal text Why that ?
    * Please help me what is the problem in my code?
    Cheers,
    JavaImran

    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    </code><code>Sax.endElement("", "basic-metadata", "basic-metadata");</code>
    <code class="jive-code jive-java">Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();     
    * I HAVE CHANGED MY AS PER YOUR SUGGESTION, NOW SAME RESULT HAS COMING.
    * I AM NOT ABLE TO GET THE EXACT OUTPUT.,WHY THAT ?
    Thanks,
    JavaImran{code}

Maybe you are looking for

  • Windows Vista home and Netweaver 7.0 installation

    Hi Experts, I am trying to install SAP Netweaver AS trail version downloaded from sdn in my laptop. Laptop(Windows vista home premium OS) is in very good configurtation but unfortunately i have not succeeded with that. Can some one guide me like step

  • R12 AR Invoice raxinv  -Customization (add columns) - need urgent help

    Hi, I need urgent help in customization of AR invoice report (raxinv) in R12. I am doing report customization for Brazil. As soon as I add one more column in report common query, build query and main query Q_invoice. Report changes to new variables i

  • Currency change in controlling area...

    Dear All,        We are demerging one company code out of 8 company codes, There is one controlling area to that 8 company codes are assigned and that controlling area currency is NOK, we demerged one company code out of 8 and put in another server a

  • Remote mx:Model source not refreshing

    Hi, I'm working on a little project, which involves an <mx:List> object being populated by an <mx:Model>. This Model takes a remote XML file as a source. However, when I update the XML file, the only way to get the List object to take the new data is

  • PHP working in IE, Firefox, Opera & Safari but not Chrome

    I'm using Dreamweaver CS5 as a development tool to get my free 000webhost.com site going. I've written a PHP script. It can work in IE9, Firefox4, Opera10.5, Safari5 but not Chrome10. In Chrome10, I got 404 error message. This is really driving me cr