Java api + polygon self intersecting.

Hi,
I am using this sdo_geom.validate_geometry_with_context to validate the polygon geometry.
Is there any equavalent oracle spatial java api to do similar validation (Oracle 10g), before loading the data. thanks.

Dear (What is your name?) User 810260,
Yes, there is the Java Topology Suite (1.12 is the latest).
Here is an example from its test harness:
public class IsValidTester {
  public IsValidTester() {
  public static void main(String[] args) throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory());
    Geometry g = reader.read("GEOMETRYCOLLECTION (POINT (110 300), POINT (100 110), POINT (130 210), POINT (150 210), POINT (150 180), POINT (130 170), POINT (140 190), POINT (130 200), LINESTRING (240 50, 210 120, 270 80, 250 140, 330 70, 300 160, 340 130, 340 130), POLYGON ((210 340, 220 260, 150 270, 230 220, 230 140, 270 210, 360 240, 260 250, 260 280, 240 270, 210 340), (230 270, 230 250, 200 250, 240 220, 240 190, 260 220, 290 230, 250 230, 230 270)))");
    IsValidOp op = new IsValidOp(g);
    if (!op.isValid()) {
      System.out.println(op.getValidationError().getMessage());
    else {
      System.out.println("OK");
}To create a JTS Geometry you can do something like this:
    public static void setPrecisionScale(int _numDecPlaces)
        precisionModelScale = _numDecPlaces < 0
                              ? (double)(1.0/Math.pow(10, Math.abs(_numDecPlaces)))
                              : (double)Math.pow(10, _numDecPlaces);
    public static String  myFunction(STRUCT _geom,
                                                int    _precision)   // _precision is decimal digits of precision NOT Oracle tolerance.
     throws SQLException
        try
            // Check geometry parameter
            if ( _geom == null )
                throw new SQLException("Supplied Sdo_Geometries is NULL.");
            // Get valid connection
            setConnection();
          int SRID = getSRID(_geom,0);  // My own function that gets the sdo_srid value from an SDO_Geometry STRUCT...
          PrecisionModel  pm              = new PrecisionModel(getPrecisionScale(_precision));   // <-- note use of getPrecisionScale method
          GeometryFactory geometryFactory = new GeometryFactory(pm,SRID);
          GeometryConverter     converter = new GeometryConverter(connection,geometryFactory);
          Geometry                    geo = converter.asGeometry(_geom);
          // Check converted geometries are valid
          if ( geo == null )
            throw new SQLException("SDO_Geometry conversion to JTS geometry returned NULL.");
          IsValidOp op = new IsValidOp(geo);
          if (!op.isValid()) {
             return op.getValidationError().getMessage();
        } catch(SQLException sqle) {
            System.err.println(sqle.getMessage());
            throw new SQLException(sqle.getMessage());
         return "TRUE";
    } If this helps you, please mark this post as the answer that got you the solution you wanted.
Simon

Similar Messages

  • Can I create a cert with the Java API only?

    I'm building a client/server app that will use SSL and client certs for authenticating the client to the server. I'd like for each user to be able to create a keypair and an associated self-signed cert that they can provide to the server through some other means, to be included in the server's trust store.
    I know how to generate a key pair with an associated self-signed cert via keytool, but I'd prefer to do it directly with the Java APIs. From looking at the Javadocs, I can see how to generate a keypair and how to generate a cert object using an encoded representation of the cert ( e.g. java.security.cert.CertificateFactory.generateCertififcate() ).
    But how can I create this encoded representation of the certificate that I need to provide to generateCertificate()? I could do it with keytool and export the cert to a file, but is there no Java API that can accomplish the same thing?
    I want to avoid having the user use keytool. Perhaps I can execute the appropriate keytool command from the java code, using Runtime.exec(), but again a pure java API approach would be better. Is there a way to do this all with Java? If not, is executing keytool via Runtime.exec() the best approach?

    There is no solution available with the JDK. It's rather deficient wrt certificate management, as java.security.cert.CertificateFactory is a factory that only deals in re-treads. That is, it doesn't really create certs. Rather it converts a DER encoded byte stream into a Java Certificate object.
    I found two ways to create a certificate from scratch. The first one is an all Java implementation of what keytool does. The second is to use Runtime.exec(), which you don't want to do.
    1. Use BouncyCastle, a free open source cryptography library that you can find here: http://www.bouncycastle.org/ There are examples in the documentation that show you how to do just about anything you want to do. I chose not to use it, because my need was satisfied with a lighter approach, and I didn't want to add a dependency unnecessarily. Also Bouncy Castle requires you to use a distinct version with each version of the JDK. So if I wanted my app to work with JDK 1.4 or later, I would have to actually create three different versions, each bundled with the version of BouncyCastle that matches the version of the target JDK.
    2. I created my cert by using Runtime.exec() to invoke the keytool program, which you say you don't want to do. This seemed like a hack to me, so I tried to avoid it; but actually I think it was the better choice for me, and I've been happy with how it works. It may have some backward compatibility issues. I tested it on Windows XP and Mac 10.4.9 with JDK 1.6. Some keytool arguments changed with JDK versions, but I think they maintained backward compatibility. I haven't checked it, and I don't know if I'm using the later or earlier version of the keytool arguments.
    Here's my code.
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.security.KeyStore;
    import java.security.KeyStoreException;
    import java.security.NoSuchAlgorithmException;
    import java.security.cert.CertificateException;
    import javax.security.auth.x500.X500Principal;
    import javax.swing.JOptionPane;
    public class CreateCertDemo {
         private static void createKey() throws IOException,
          KeyStoreException, NoSuchAlgorithmException, CertificateException{
         X500Principal principal;
         String storeName = ".keystore";
         String alias = "keyAlias";
         principal = PrincipalInfo.getInstance().getPrincipal();
         String validity = "10000";
         String[] cmd = new String[]{ "keytool", "-genKey", "-alias", alias, "-keyalg", "RSA",
            "-sigalg", "SHA256WithRSA", "-dname", principal.getName(), "-validity",
            validity, "-keypass", "keyPassword", "-keystore",
            storeName, "-storepass", "storePassword"};
         int result = doExecCommand(cmd);
         if (result != 0){
              String msg = "An error occured while trying to generate\n" +
                                  "the private key. The error code returned by\n" +
                                  "the keytool command was " + result + ".";
              JOptionPane.showMessageDialog(null, msg, "Key Generation Error", JOptionPane.WARNING_MESSAGE);
         KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
         ks.load(new FileInputStream(storeName), "storePassword".toCharArray());
            //return ks from the method if needed
    public static int doExecCommand(String[] cmd) throws IOException{
              Runtime r = Runtime.getRuntime();
              Process p = null;
              p = r.exec(cmd);
              FileOutputStream outFos = null;
              FileOutputStream errFos = null;
              File out = new File("keytool_exe.out");
              out.createNewFile();
              File err = new File("keytool_exe.err");
              err.createNewFile();
              outFos = new FileOutputStream(out);
              errFos = new FileOutputStream(err);
              StreamSink outSink = new StreamSink(p.getInputStream(),"Output", outFos );
              StreamSink errSink = new StreamSink(p.getErrorStream(),"Error", errFos );
              outSink.start();
              errSink.start();
              int exitVal = 0;;
              try {
                   exitVal = p.waitFor();
              } catch (InterruptedException e) {
                   return -100;
              System.out.println (exitVal==0 ?  "certificate created" :
                   "A problem occured during certificate creation");
              outFos.flush();
              outFos.close();
              errFos.flush();
              errFos.close();
              out.delete();
              err.delete();
              return exitVal;
         public static void main (String[] args) throws
              KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException{
              createKey();
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.io.PrintWriter;
    //Adapted from Mike Daconta's StreamGobbler at
    //http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4
    public class StreamSink extends Thread
        InputStream is;
        String type;
        OutputStream os;
        public StreamSink(InputStream is, String type)
            this(is, type, null);
        public StreamSink(InputStream is, String type, OutputStream redirect)
            this.is = is;
            this.type = type;
            this.os = redirect;
        public void run()
            try
                PrintWriter pw = null;
                if (os != null)
                    pw = new PrintWriter(os);
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null)
                    if (pw != null)
                        pw.println(line);
                    System.out.println(type + ">" + line);   
                if (pw != null)
                    pw.flush();
            } catch (IOException ioe)
                ioe.printStackTrace(); 
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.security.auth.x500.X500Principal;
    public class PrincipalInfo {
         private static String defInfoString = "CN=Name, O=Organization";
         //make it a singleton.
         private static class PrincipalInfoHolder{
              private static PrincipalInfo instance = new PrincipalInfo();
         public static PrincipalInfo getInstance(){
              return PrincipalInfoHolder.instance;
         private PrincipalInfo(){
         public X500Principal getPrincipal(){
              String fileName = "principal.der";
              File file = new File(fileName);
              if (file.exists()){
                   try {
                        return new X500Principal(new FileInputStream(file));
                   } catch (FileNotFoundException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                        return null;
              }else{
                   return new X500Principal(defInfoString);
         public void savePrincipal(X500Principal p) throws IOException{
              FileOutputStream fos = new FileOutputStream("principal.der");
              fos.write(p.getEncoded());
              fos.close();
    }Message was edited by:
    MidnightJava
    Message was edited by:
    MidnightJava

  • OIM Java API silently ignores accounts operations such as enable/disable/revoke

    Hi
    I am facing a strange situation here.
    My Java app (standalone) was able to set provisioned accounts to "enabled" and then disabled these enabled ones.
    Now, provisioned accounts can't be enabled anymore.
    Commands issued from Java API using ProvisioningService such as "enable", "disable" and "revoke" are being simply ignored. No exception raised, no changes.
    Am I missing some step? Do I need to run any scheduled job in order to "commit" these changes performed from the OIM Java API?
    How do I debug this?
    TIA

    Sorry for my ignorance, but where's this "resource history" thing in OIM?
    Here's what I am doing.
    First, I use the Self Service UI to provision an account. This account belongs to an application instance backed by the OIM Webservice connector.
    I suppose it works because after requesting the account, the connector creates it and returns back a unique ID (which is assigned to the account uid) and the account shows up in "my accounts" tab as "provisioned".
    So far, so good.
    THEN
    I run my standalone java app from outside OIM, which uses OIM Java API. This app connects to OIM as xelsysadm, and I search for the account and do something like this
    public void enableAccount(String uid) throws AccessDeniedException, NumberFormatException, AccountNotFoundException, ImproperAccountStateException,
        GenericProvisioningException, InvalidUidException {
      Account a = findAccountIdByUID(uid);
      if (a != null) {
        System.out.println("enabling "+a.getAccountID()+":"+a.getAccountStatus()+":"+a.getAccountData().getData().get("UD_AVNC_USR_LOGIN")); <<< here I confirm I am changing the right account, it is
        ProvisioningService provService = oimClient.getService(oracle.iam.provisioning.api.ProvisioningService.class);
        provService.enable(Long.parseLong(a.getAccountID()));
      }else {
        throw new InvalidUidException(uid);
    then I expect to refresh "my accounts" tab and see my account status changed from "Provisioned" to "Enabled".
    I don't know if these screenshots may help, but anyway
    These are the tasks for the provisioning process. I believe the one we're interested here is the #22
    these are the status definitions for the process. They're also created by default during the OIM webservice connector module import process I guess
    these are the task to object status mapping for the task #22 below, also created automatically I guess.
    I am a little bit confused because the OIM manual -- http://docs.oracle.com/cd/E27559_01/user.1112/e27151/myaccess.htm#OMUSG3166 -- says the user can just perform the operations on the accounts, but says nothing about any kind of restriction. I mean, what are exactly the state transition for accounts (the default one)?
    TIA

  • Unable to raise password expiry warning exception in OID using JAVA API

    Hi,
    We are maintaing the user information for our application in OID(9.2). During logon, it is required that a warning is given to the user according to the value set in "Password Expiration Warning" parameter.
    A pl/sql program (using DBMS_LDAP/DBMS_LDAP_UTL packages) written to test password expiry raises the PWD_EXPIRE_WARN exception as expected. However we are unable to simulate the same using the JAVA APIs.
    We did try some thing like the following:
    public class SampleExpire {
    public static void main(String argv[])
    throws NamingException {
    // Create InitialDirContext
    InitialDirContext ctx = ConnectionUtil.getDefaultDirCtx( "TCS-UUODC4",
    "4032",
    "cn=orcladmin",
    "welc0me" );
    System.out.println("Hello");
    // Create User Objects
    User myuser = null,
    try {
    // Create User using a subscriber DN and the User DN
    myuser = new User ( ctx,
    Util.IDTYPE_DN,
    "uid=C100013, ou=People, o=UUSD",
    Util.IDTYPE_DN,
    "ou=People, o=UUSD",
    false );
    catch ( UtilException e ) {
    * Exception encountered in User object constructor
    System.out.println("User creation failed");
    // Authenticate User
    try {
    myuser.authenticateUser(ctx,User.CREDTYPE_PASSWD,"Z100013");
    catch ( UtilException e ) {
    * Authenticate fails
    System.out.println("Authentication failed");
    } // End of SampleExpire.java
    The authenticate user does not raise any exception.
    Am I missing something ?
    Regards -
    Adhiraj

    Hi,
    did you manage to solve this problem? Please let me know

  • Unable to run the 9.3 JAVA API in "embedded" mode without APS installed

    <p>Hello,</p><p> </p><p>I'm trying to run the 9.3 JAVA API in "embedded" modewithout APS installed.</p><p> </p><p>I first used build Build <b>242</b> which was supplied with 9.3beta. This worked great and exactly the way I wanted to.</p><p>Now I'm trying to do the same with the production release of 9.3JAPI which is (to my knowledge) build <b>305</b>. With build 305I'm not able to connect to Essbase without APS installed.</p><p> </p><p>The reason I do not want to install APS is because I'm runningthe Java code from with an Oracle database (the JAPI jars areloaded into the database)</p><p> </p><p>Please see below loglines (running the sampleConnect.class):</p><p> </p><p><span style=" text-decoration: underline;"><b>Build 242 (whichworks ok)</b></span></p><p>Java(TM) 2 Runtime Environment, Standard Edition (build1.4.2_06-b03)<br>Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)<br>WARN [main]: - Time: Mon Feb 12 08:53:24 CET 2007, AnalyticProvider Services - Release 9.3.0.0 Build 242<br>Copyright (c) 1991-2006 Hyperion Solutions Corporation. All rightsreserved.<br>connection mode : EMBEDDED<br>WARN [main]: - Time: Mon Feb 12 08:53:25 CET 2007, connection mode: EMBEDDED<br>essbase.properties: essbase.properties<br>WARN [main]: - Time: Mon Feb 12 08:53:25 CET 2007,essbase.properties: essbase.properties<br>domain.db location: ./domain.db<br>WARN [main]: - Time: Mon Feb 12 08:53:25 CET 2007, domain.dblocation: ./domain.db<br>WARN [main]: - Time: Mon Feb 12 08:53:25 CET 2007,cluster.monitor.interval : 30</p><p>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: sign on (from user Administrator session number 5178)<br>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: get my analytics mode (from user Administrator sessionnumber 5178)<br>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: (from user '**aps_profile is Enabled**' session numberfalse)<br>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: connect to olap service (from user Administrator sessionnumber 5178)<br>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: (from user '**aps_profile is Enabled**' session numberfalse)<br>Connection to Analyic server '10.130.60.78' was successful.<br>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: sign off (from user Administrator session number 5178)<br>Process exited with exit code 0.<br></p><p> </p><p><span style=" text-decoration: underline;"><b>Build 305 (whichdoes not work ok)</b></span></p><p>Java(TM) 2 Runtime Environment, Standard Edition (build1.4.2_06-b03)<br>Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)<br>WARN [main]: - Time: Mon Feb 12 08:54:28 CET 2007, AnalyticProvider Services - Release 9.3.0.0 Build 305<br>Copyright (c) 1991-2006 Hyperion Solutions Corporation. All rightsreserved.<br>connection mode : EMBEDDED<br>WARN [main]: - Time: Mon Feb 12 08:54:28 CET 2007, connection mode: EMBEDDED<br>essbase.properties: essbase.properties<br>WARN [main]: - Time: Mon Feb 12 08:54:28 CET 2007,essbase.properties: essbase.properties<br>domain.db location: ./domain.db<br>WARN [main]: - Time: Mon Feb 12 08:54:28 CET 2007, domain.dblocation: ./domain.db<br>WARN [main]: - Time: Mon Feb 12 08:54:28 CET 2007,cluster.monitor.interval : 30</p><p>INFO [main]: - Time: Mon Feb 12 08:54:28 CET 2007,<br>[Mon Feb 12 08:54:28 CET 2007] - Service using EMBEDDED<br>Request: sign on (from user Administrator session number 68529)<br>INFO [main]: - Time: Mon Feb 12 08:54:28 CET 2007,<br>[Mon Feb 12 08:54:28 CET 2007] - Service using EMBEDDED<br>Request: get my analytics mode (from user Administrator sessionnumber 68529)<br>INFO [main]: - Time: Mon Feb 12 08:54:28 CET 2007,<br>[Mon Feb 12 08:54:28 CET 2007] - Service using EMBEDDED<br>Request: connect to olap service (from user Administrator sessionnumber 68529)<br>Error: Cannot connect to olap service. null<br>INFO [main]: - Time: Mon Feb 12 08:54:28 CET 2007,<br>[Mon Feb 12 08:54:28 CET 2007] - Service using EMBEDDED<br>Request: sign off (from user Administrator session number68529)<br>Process exited with exit code 1.</p>

    <p>Hello,</p><p> </p><p>I'm trying to run the 9.3 JAVA API in "embedded" modewithout APS installed.</p><p> </p><p>I first used build Build <b>242</b> which was supplied with 9.3beta. This worked great and exactly the way I wanted to.</p><p>Now I'm trying to do the same with the production release of 9.3JAPI which is (to my knowledge) build <b>305</b>. With build 305I'm not able to connect to Essbase without APS installed.</p><p> </p><p>The reason I do not want to install APS is because I'm runningthe Java code from with an Oracle database (the JAPI jars areloaded into the database)</p><p> </p><p>Please see below loglines (running the sampleConnect.class):</p><p> </p><p><span style=" text-decoration: underline;"><b>Build 242 (whichworks ok)</b></span></p><p>Java(TM) 2 Runtime Environment, Standard Edition (build1.4.2_06-b03)<br>Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)<br>WARN [main]: - Time: Mon Feb 12 08:53:24 CET 2007, AnalyticProvider Services - Release 9.3.0.0 Build 242<br>Copyright (c) 1991-2006 Hyperion Solutions Corporation. All rightsreserved.<br>connection mode : EMBEDDED<br>WARN [main]: - Time: Mon Feb 12 08:53:25 CET 2007, connection mode: EMBEDDED<br>essbase.properties: essbase.properties<br>WARN [main]: - Time: Mon Feb 12 08:53:25 CET 2007,essbase.properties: essbase.properties<br>domain.db location: ./domain.db<br>WARN [main]: - Time: Mon Feb 12 08:53:25 CET 2007, domain.dblocation: ./domain.db<br>WARN [main]: - Time: Mon Feb 12 08:53:25 CET 2007,cluster.monitor.interval : 30</p><p>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: sign on (from user Administrator session number 5178)<br>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: get my analytics mode (from user Administrator sessionnumber 5178)<br>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: (from user '**aps_profile is Enabled**' session numberfalse)<br>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: connect to olap service (from user Administrator sessionnumber 5178)<br>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: (from user '**aps_profile is Enabled**' session numberfalse)<br>Connection to Analyic server '10.130.60.78' was successful.<br>INFO [main]: - Time: Mon Feb 12 08:53:25 CET 2007,<br>[Mon Feb 12 08:53:25 CET 2007] - Service using EMBEDDED<br>Request: sign off (from user Administrator session number 5178)<br>Process exited with exit code 0.<br></p><p> </p><p><span style=" text-decoration: underline;"><b>Build 305 (whichdoes not work ok)</b></span></p><p>Java(TM) 2 Runtime Environment, Standard Edition (build1.4.2_06-b03)<br>Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)<br>WARN [main]: - Time: Mon Feb 12 08:54:28 CET 2007, AnalyticProvider Services - Release 9.3.0.0 Build 305<br>Copyright (c) 1991-2006 Hyperion Solutions Corporation. All rightsreserved.<br>connection mode : EMBEDDED<br>WARN [main]: - Time: Mon Feb 12 08:54:28 CET 2007, connection mode: EMBEDDED<br>essbase.properties: essbase.properties<br>WARN [main]: - Time: Mon Feb 12 08:54:28 CET 2007,essbase.properties: essbase.properties<br>domain.db location: ./domain.db<br>WARN [main]: - Time: Mon Feb 12 08:54:28 CET 2007, domain.dblocation: ./domain.db<br>WARN [main]: - Time: Mon Feb 12 08:54:28 CET 2007,cluster.monitor.interval : 30</p><p>INFO [main]: - Time: Mon Feb 12 08:54:28 CET 2007,<br>[Mon Feb 12 08:54:28 CET 2007] - Service using EMBEDDED<br>Request: sign on (from user Administrator session number 68529)<br>INFO [main]: - Time: Mon Feb 12 08:54:28 CET 2007,<br>[Mon Feb 12 08:54:28 CET 2007] - Service using EMBEDDED<br>Request: get my analytics mode (from user Administrator sessionnumber 68529)<br>INFO [main]: - Time: Mon Feb 12 08:54:28 CET 2007,<br>[Mon Feb 12 08:54:28 CET 2007] - Service using EMBEDDED<br>Request: connect to olap service (from user Administrator sessionnumber 68529)<br>Error: Cannot connect to olap service. null<br>INFO [main]: - Time: Mon Feb 12 08:54:28 CET 2007,<br>[Mon Feb 12 08:54:28 CET 2007] - Service using EMBEDDED<br>Request: sign off (from user Administrator session number68529)<br>Process exited with exit code 1.</p>

  • Get All group from LCES using Livecycle java API

    Hello ,
    Can anyone told me how i can retrieve all the groups that exist in my livecyle using JAVA API.
    Some method who return all groups ??
    Thanks!

    First Thank you for your answer
    I tried this part
    //Set connection properties required to invoke LiveCycle ES
                Properties connectionProps = new Properties();
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://test:1099");
                                                                      connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
                ServiceClientFactory scf = ServiceClientFactory.createInstance(connectionProps);
                DirectoryManager directoryManager = new DirectoryManagerServiceClient(scf);
                PrincipalSearchFilter psf = new PrincipalSearchFilter();
        psf.setPrincipalType(Principal.PRINCIPALTYPE_GROUP);  //Recommended - refines the search to a User or Group
        psf.setRetrieveOnlyActive(); // Recommended - returns only ative users/groups and not obsolete/deleted users/groups
        List<Principal> resultList = directoryManager.findPrincipals(psf);
        System.out.println("Done");
    and when I check the result of my list I find incomprehensible informations.
    So when I debug the code ,  my list  contains little information.
    NB : my LDAP contains hundreds of groups.
    Any suggestion
    Any code Source.

  • Java API to read the Encrypted Values from Windows Registry settings

    Is there any Java API to read the Encrypted Values from Windows Registry settings ?
    My Java Application invokes a 3rd party Tool that writes the key/value to windows registry settings under : “HKLM\Software\<3rdparty>\dataValue”.
    This entry is in BINARY and encrypted with 3DES, using crypto API from Microsoft.
    3rd party software to encrypt the data stored in registry it
    either uses C++ code: and uses the call “CryptProtectData” and “CryptUnProtectData” or
    If it is a .NET (C#) it uses the call “Protect” or “UnProtect” from class “ProtectData” of WinCrypt.h from the library “Crypt32.lib.
    Note: The data is encrypted using auto-generated machinekey and there is no public key shared to decrypt the Encrypted data.
    Since the data is encrypted using auto-generated machinekey the same can be decrypted from a .Net / C++ application using CryptUnprotectData or UnProtect() API of WinCrypt.h from the library “Crypt32.lib.
    To know more about Auto-Generated MachineKey in Windows refer the links below
    http://aspnetresources.com/tools/machineKey
    http://msdn.microsoft.com/en-us/library/ms998288.aspx
    I need to find a way in Java to find the equivalent API to decrypt (CryptUnprotectData) and Microsoft will automatically use the correct key.
    But i couldn't find any informato related to Java APIs to enrypt or decrypt data using auto-generated machinekey.
    Is there a way to read the encrypted data from Windows regsitry settings that is encrypted using the Auto-Generated Machine Key ?
    Kindly let me know if Java provides any such API or mechanism for this.

    If the symmetric key is "auto-generated" and is not being stored anywhere on the machine, it implies that the key is being regenerated based on known values on the machine. This is the same principle in generating 3DES keys using PBE (password-based-encryption). I would review the documentation on the C# side, figure out the algorithm or "seed" values being used by the algorithm, and then attempt to use the JCE to derive the 3DES key using PBE; you will need to provide the known values as parameters to the PBE key-generation function in JCE. Once derived, it can be used to decrypt the ciphertext from the Regiistry in exactly the same way as the CAPI/CNG framework.
    An alternate way for Java to use this key, is to write a JNI library that will call the native Windows code to do the decryption; then the Java program does not need to know details about the key.
    That said, there is a risk that if your code can derive the key based on known seeds, then so can an attacker. I don't know what your applicatiion is doing, but if this is anything related to compliance for some data-security regulation like PCI-DSS, then you will fail the audit (for being unable to prove you have adequate controls on the symmetric key) if a knowledgable QSA probes this design.
    Arshad Noor
    StrongAuth, Inc.

  • Which Java API could check the type of Operating System the JVM is running?

    Does anyone know which Java API could check the type of Operating System the JVM is running?
    thanks a lot!

    check out System class.
    regards
    shyamAnd specifically, the getProperty() method.
    - K

  • Performance of Java API 2

    Hello,
    we are currently using Java API 2 that comes with MDM 5.5 SP5 (Build 5.5.42.65) to read extended information from the mdm repository.
    Our process:
    We are export every product as a XML file over the MDM Syndicator and enrich this file with extended information from the API (This step is needed because we cannot export all data by the Syndicator, for example multilingual attributes / some product data like textblocks / id's for incremental updates ...).
    Actually the performance is really bad, we need ca. 10-15 secs to process one file, that is really frustrating when you have stored near 70.000 products in your repository.
    Are there some tricks to improve the performance or is the API really so slow? Or any better alternatives for an fast export?
    Thanks for your help ....
    Best Regards,
    Jan

    1 - If you are able to use the EJB connection with the LiveCycle SDK classes (you have are using a supported java version such as 1.5_xx, your network security doesn't prevent RMI calls, etc.) then that is your best bet.
    2 - Yes, you will need the java APIs to be accessible for your application. The LiveCycle APIs have remote EJB endpoints so you can access them from another server.
    3 - There are samples that ship with the LiveCycle server (located in your LCInstall\LiveCycle_ES_SDK\samples\Forms). There are also samples on the LiveDocs page at: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000064.html

  • Invalid Argument Exception on Java API's DB Close

    When closing the database via the Java API's close method, I am getting an invalid argument exception... how can this be fixed... subsequent access to the DB causes the JVM to crash??
    ERROR: An exception has occurred: java.lang.IllegalArgumentException: Invalid argument
    java.lang.IllegalArgumentException: Invalid argument
    at com.sleepycat.db.internal.db_javaJNI.DbEnv_close0(Native Method)
    at com.sleepycat.db.internal.DbEnv.close0(DbEnv.java:217)
    at com.sleepycat.db.internal.DbEnv.close(DbEnv.java:77)
    at com.sleepycat.db.Environment.close(Environment.java:39)
    at com.sleepycat.dbxml.XmlManager.closeInternal(XmlManager.java:301)
    at com.sleepycat.dbxml.XmlManager.delete(XmlManager.java:33)
    at com.sleepycat.dbxml.XmlManager.close(XmlManager.java:310)
    at com.iconnect.data.adapters.BerkleyXMLDBImpl.insert(BerkleyXMLDBImpl.java:827)
    at com.iconnect.data.DataManagerFactory.insert(DataManagerFactory.java:182)
    at Xindice2Berkley.main(Xindice2Berkley.java:99)

    I had the same problem. I could fix it by carefully calling the delete() function on all those DBXML Xml..xyz objects that you create when you perform queries etc. It seems that those Java objects have some 'shadow' object in the underlying DLL and by calling delete() you free resources that remain otherwise assigned (maybe somebody with a C++ background who programmed this stuff?). Call delete() before the Java object gets out of scope. For instance:
    results = mgr.query(collection,context,null);
    XmlValue value;
    try {
    while ((value = results.next()) != null) {
    XmlValue c = value.getFirstChild();
    String ref = c.getNodeValue();
    c.delete(); c = null;
    value.delete(); value = null;
    catch (Exception e) {
    finally {
    if (results != null) {
    results.delete();
    results = null;
    Once i did this on all possible dbxml objects i used in my code, the java.lang.IllegalArgumentException: Invalid argument disappeared.
    Message was edited by:
    user562374

  • Can i create more than one attributes for the custom class created using java API

    Hello everyone,
    I have been creating class and its attributes programatically using java APIs, I want to know that is there any way to create multipal attributs for the same class in just one call of API with all the options for each attributes,
    thanks

    You can create a new class and define all of the Attributes at the time the class is created - this is the preferred way of creating classes. Use the addAttributeDefinition() method on ClassObjectDefinition. If you need to add attributes to existing classes, you can only add them one at a time (using the addAttribute() method on ClassObject).
    (dave)

  • Replication of Berkeley DB Xml Edition with the help of JAVA API

    hi,
    i am trying to replicate berkeley DB to 2 other replicas.with the help of small program which along with its documentation(of chapter 3). And i'm using java API for the same(specifically replication framework program.)
    All necessary files are get created at host side like log files, dll files, db files. But at replica(client) side nothing get created. Host and clients are placed in the same network.
    But unfortunately its not working. don't know the reason. And its not giving any sort of error. And i dont know how to go ahead. Or is there any other way should i proceed with.
    So could you help me out to get rid of this problem.
    Thanks

    What compiler are you running?
    See this message and thread:
    Re: Problem after update to 2.3.8
    It may be necessary to apply the -fno-strict-aliasing flag to the Berkeley DB Java library as well.
    Regards,
    George

  • How to find bpel instance in 11g based on the index values using Java APIs

    Hi ,
    In SOA10G we had option to find the instances based on the index value using Java APIs like below.
    WhereCondition criteria= new WhereCondition(SQLDefs.CX_index_1 + " = ?");
    criteria.setString(1, "indexValue");
    Locator mLoc = getLocator();
    IInstanceHandle[] foundInstances = mLoc.listInstancesByIndex(criteria);
    Please tell me how to achieve the same functionality in SOA 11G using Java APIs
    Regards,
    Saba

    I have multiple bpel in my composite. I checked in ci_indexes table and it shows the instance number of the bpel process. But the em console is showing only the composite instance number. when I opened composite instance, I could see all the bpel process with instance number in the audit trail. How can I find the the actual composite instance number that I should search for in the em console ???

  • Bug report (and solution): adding multiple records through Java API in bulk

    I have found some bugs in the Java API (version 4.1.25) that makes it impossible to add mulitple values in bulk to a RECNO database. The fixes are as follows:
    MultipleEntry.java, line 80:
    "DbUtil.int2array(curr_off, this.data, pos);"
    should be replaced by
    " DbUtil.int2array(recno, this.data, pos);"
    MultipleRecnoDatabaseEntry.java, line 130:
    "return append_internal(data, doff, dlen, recno);"
    should be replaced by
    "return append_internal(data, offset, len, recno);"
    Regards,
    Johan Walters

    Hello,
    It looks like there were some corrections to this area in the post 4.1 i.e. 4.2 release. And I do not see these same issues in the current 5.1.25 release. If you do find them in the current release, just let us know.
    Thanks,
    Sandra

  • How can I create a new User with the Java API like OIDDAS do?

    Hello,
    I'm currently working on an BPEL based process. And i need to create an OCS user. So far I can create an user in the OID. But I cant find any documentation about given this user an email account,calendar and content function etc.
    Did anybody know if there are some OIDDAS Webservices? Or did anybody know how to do this using the Java APIs?

    You are asking about a Database User I hope.
    You can look into the Oracle 8i Documentation and find various privillages listed.
    In particular, you may find:
    Chapter 27 Privileges, Roles, and Security Policies
    an intresting chapter.
    You may want to do this with the various tools included with 8i - including the
    Oracle DBA Studio - expand the Security node and you can create USERS and ROLES.
    Or use SQL*Plus. To create a
    user / password named John / Smith, you would login to SQL*Plus as System/manager (or other) and type in:
    Create user John identified by Smith;
    Grant CONNECT to John;
    Grant SELECT ANY TABLE to John;
    commit;
    There is much more you can do
    depending on your needs.
    Please read the documentation.
    -John
    null

Maybe you are looking for