ESRI to Java

Hi,
I want to convert a shapefile into GML or Java object.
i was successfully able to convert from ESRI to GML using the GDAL/OGR
library, but regarding the same i want to know if the conversion is
possible using Java classes ie executing the command in Java.
Generally the conversion needs to be done on the command prompt
provided ny FWTools package. so i want to know if the command could be
executed in java itself.
PS: IF anybody knows how to convert esri shapefile directly to java,
it would be helpful.
TIA

Yeah.. i tried that.. but the problem is i cannot use exec() function as a command line. It can be used only for executables( according to what i read in Javaworld)
Anyhoo i tried using that with this command but to no avail.
Any other method? or can anyone tell me how to directly comvert an ESRI shapefile to Java?
TIA

Similar Messages

  • Problems with j2re and j2sdk's j2re

    OK I know that subject doesn't make much sense, but this is rather hard to explain.
    Has anyone else had any issues with the the Java2 1.4 SDK's jre (The software dev kit along with the jre) and just the 1.4 jre installation files? Basically it's this:
    j2re-1_4_0-win.exe - JRE ONLY
    j2sdk-1_4_0-win.exe - SDK + JRE
    Even though both of these files install the same version of the jre, I'm thinking they are different in some way (either a bug or on purpose I don't know).
    I've been developing some ESRI MapOjects Java applications and ran into this issue when making an applet.
    Installing the jre with j2sdk-1_4_0-win.exe will make the applet work, but just installing the jre itself (j2re-1_4_0-win.exe - the one your web browser will make you d/l if you don't have jre 1.4) will make the applet unworkable.
    The particular problem is with file access. I download the files to the local machine then use them later on in the program. The sdk-jre doesn't have a problem with this, but the jre only version does for some reason. Even after downloading the files and checking if they exist, are readable, and are writable (all three returned true) it still treats the files as nonexistant.
    Obviously this is very puzzling and was wondering if anyone else has had something like this happen to them, and if not maybe Sun should look into this since this has really made my applet pointless (what's the point of using an applet if you have to d/l a 30+ meg file in order to run it vs the 9 meg file that won't run it :) ).
    Not that my applet is Sun's major concern, :) but if this becomes a reocurring problem with others then it should be investigated.
    To answer the first question if any will arise in this thread, yes my applet is digitally signed and it's not just my computer. I have this happen on four other computers until I saw the pattern and installed the sdk on them. Then the applet started to work.

    There is the possibility of differences between the various runtimes, but I can't see them causing the type of problem you note.
    A separately d/l'd JRE can be either an "English-only" version or an "International" version. (The 2 installed as part of the SDK are the "International" version.)
    Both JRE's that are installed as part of the SDK have 2 separate bytecode-to-native compiler binaries - Client and Server versions, selectable via java.exe options. A separately d/l'd JRE has only the Client binary (both English-only and International versions).
    Using the current Plugins, it's not necessary to use the HTML converter (quoted from Sun):
    "Beginning with J2SE 1.3.1_01a, Java Plug-in supports <applet> tags for launching applets and for initiating autodownload of the JRE/Java Plug-in on Microsoft Windows platforms. For more information, see Java Plug-in Developer Documentation"
    I'm of the opinion that some environment difference - classpath, Plugin settings, etc. is causing the difference between runtimes.

  • Using Java oracle.spatial.util.SampleShapefileToJGeomFeature : ESRI SHP

    Hi,
    I am trying to import an ESRI shapefile using the Java class oracle.spatial.util. I have to add a remark, that I have set the classpath with the command
    set classpath=.;%ORACLE_HOME%\jdbc\lib\ojdbc14.jar
    I am using Oracle 11g and I don't have this file in the LIB library, only
    ojdbc5.jar
    ojdbc5dms.jar
    ojdbc5dms_g.jar
    ojdbc5_g.jar
    ojdbc6.jar
    ojdbc6dms.jar
    ojdbc6dms_g.jar
    ojdbc6_g.jar
    set classpath=.;%ORACLE_HOME%\md\jlib\sdoapi.jar (file exists)
    set classpath=.;%ORACLE_HOME%\md\jlib\sdoutl.jar (file exists)
    set classpath=.;%ORACLE_HOME%\lib\xmlparserv2.jar (file exists)
    java oracle.spatial.util.SampleShapefileToJGeomFeature -h nt-topobase -p 1521 -s ORCL -u rlv -d admin -t dkn -f KO_shp - 5000000 -g geom
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/spatial/util/S
    ampleShapefileToJGeomFeature
    Caused by: java.lang.ClassNotFoundException: oracle.spatial.util.SampleShapefile
    ToJGeomFeature
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    I am not sure, why I am getting those errors.

    hi,
    I dont know how to use the SampleShapefileToJGeomFeature Java Class. I have tried 2 syntax
    oracle@oraclesig:/$ java -cp $clpath oracle.spatial.util.SampleShapefileToJGeomFeature -h http://localhost -p 1521 -s SIG -u my_user -d my_pass_word -t my_shape -f /home/oracle/perso/topo/my_shape -r 4326 -g geom
    Parameters:
    <Filename>: File name of an input Shapefile (without extension)
    <Table name>: Table name for the result
    \[SRID\]: Valid Oracle SRID for coordinate system; use 0 if unknown
    <ID Column name>: Column name for unique numeric ID; if required
    oracle@oraclesig:/$ java -cp $clpath oracle.spatial.util.SampleShapefileToJGeomFeature /home/oracle/perso/topo/ma_couche ma_couche 2154 id_com
    Connecting to DB...
    java.sql.SQLException: Exception d'E/S: The Network Adapter could not establish the connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    at oracle.spatial.util.SampleShapefileToJGeomFeature.main(SampleShapefileToJGeomFeature.java:110)
    Dropping old table...
    Exception in thread "main" java.lang.NullPointerException
    at oracle.spatial.util.SampleShapefileToJGeomFeature.prepareTableForData(SampleShapefileToJGeomFeature.java:252)
    at oracle.spatial.util.SampleShapefileToJGeomFeature.main(SampleShapefileToJGeomFeature.java:129)
    Can you help me for the syntaxe oh the commande?
    Thanks! Regards.
    Ben.
    Edited by: user12240435 on Dec 15, 2009 12:59 AM

  • Java WSDP 1.4 is not parsing SOAP Exceptions

    We used Java WSDP 1.4 toolkit to generate stubs for webservices. We used Tomcat 5.1 as the web container. When methods of the webservice are invoked which do not return SOAP exception responses, WSDP is able to properly parse the response and display the resutls correctly. But when the responses contains SOAP exceptions, WSDP always returns
    "java.rmi.RemoteException: Runtime exception; nested exception is: trailing block elements must have an id attribute".
    But other toolkits like Axis 1.1,.Net,ColdFusionMX,Glue are returning proper exceptions messages. The following is the exception message received from the other toolkits for the same method invocation.
    "Exception has been thrown by the target of an invocation. '1000:Invalid data source name 'invalid_String'"
    Apart from Java WSDP all the other toolkits that we mentioned are able to parse the exception message properly and display the same.
    Any ideas why the toolkit is behaving like this. All the versions of Java WSDP that have come till date have a similar problem. We would be happy to hear any responses for the problem the we are facing in Java WSDP 1.4. At present we have decided not to use the toolkit for any web service development.

    Am specifying the URL of the WSDL file for which we are unable to get proper SOAP Exceptions, whenever they are generated. Whenever we give valid values while invoking the methods, the response is properly parsed, but when a SOAP Exception is supposed to be generated, it generally returns the Runtime exception that we mentioned. Can you please look into it and identify the reason about why it is failing. In case you are able to run it through properly, please attach the code that would make it work properly.
    The URL is :
    http://arcweb.esri.com/services/v2/PlaceFinderSample.wsdl

  • JDBC connection error in Crystal Reporting through ESRI Dekho product

    Wow, I am so far out of my depth here I am not even sure I am in the correct forum.  I have recently started using the GIS software ESRI product Dekho (a web based browser basically) and the reporting tool is Crystal Reports.  The JDBC connection required for me to connect to data held in a corporate oracle db is failing with a driver error and I don't know how to troubleshoot it.  ESRI support seem to think it's a Crystal Reports issue.  If anyone has any idea what I am talking about please respond, including pointing me to a forum which might assist, if this one is not where I should be asking such a question.  Thanks in advance.

    Simon here from Esri Australia, I work in the support team for the Dekho product, that this client was having problems with.
    We established that our Dekho product was passing the relevant information over to Crystal and that Crystal was having issues connecting to a database due to an issue with Crystal not having the correct JBDC drivers installed.
    = Therefore we concluded that the client should get in touch with you to resolve these JDBC driver issues.
    The error in the report is:
    ['Failed to open the connection, Details:JDBC driver not found"|http://i7.photobucket.com/albums/y254/jak-c/Outlook1.jpg]
    We believe that the issue is specifically a Crystal Reports issue on connecting to an Oracle database. 
    If we take Dekho out of the equation, the issue is still apparent.
    We did some testing on Oracle XE and were able to get it to communicate with Crystal Reports ok.
    We had to make the following change:
    1. copied the database drivers from:
    C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib
    to
    C:\Program Files (x86)\Business Objects\Common\4.0\java\lib\external\
    2. Edit "C:\Program Files (x86)\Business Objects\Common\4.0\java\lib" to include the above JAR file into the classpath tag.
    We touch on this in [our own web-help|http://www.dekho.com.au/help/31/default.htm?turl=Documents%2Fconfigurecrystalreports.htm], although this is more specific to SQL Server.
    The client had problems setting up this Crystal Reports to Oracle link, due to drivers missing.
    Can you generate a support ticket for this client and assist her with getting CR drivers working with her version of Oracle?
    As a sidenote - Esri Australia is a distributor for Esri, and not sure if the OEM extends to us?
    We would like to get a better relationship with you on how to deal with Crystal related issues with our own product.
    For issues like the above, we would like to come up with a more efficient means for our clients to get resolutions to their issues, and if the issue stems to outside our product - a good process for our support team to log a ticket on behalf of our client and pass all the relevant info across, so that a solution can be resolved quickly.
    - Do you have a contact in Australia that we could talk to about this?
    Let me know if you need the clients contact details - I believe this is still an issue for her.

  • OLE Objects - How to open them in Java?

    Hello ppl,
    An OLE Object contains a header set by the Access Database and the file itself.
    I just quit trying to find a way to remove the OLE header and get only the file, once the file inside the OLE Object might be from a lot of types, like docs, or pdfs...
    Now, I just want to take this OLE Object and open it from Java.
    Does anybody know any way for me to do this?
    http://edndoc.esri.com/arcobjects/9.2/java/api/arcobjects/com/esri/arcgis/carto/IOleFrameProxy.html#open()
    In this link, this method describes exactly what I want. But I don�t think I�m allowed to use it.
    Isn�t there any free library that helps inthis subject?
    Thanks in advice.

    I don't see that this is a JDBC topic.
    Presumably you googled for this.
    You can of course write JNI code to access OLE.

  • Where is: SampleShapefileToJGeomFeature.java

    We are starting an Oracle Spatial project and need to convert a few hundred ESRI shapefiles to a SDO_GEOMETRY datatype.
    Where can I find the SampleShapefileToJGeomFeature.java file and JAR files to help with the conversion?
    Thanks in advance...

    Check this forum post:
    Question on parms for SampleShapefileToJGeomFeature loader

  • Java Exception with SDO_UTIL.FROM_WKTGEOMETRY

    Anyone have any idea why the following is not working?
    INSERT INTO "OBJECT_EVENT" ("title", GEOMETRY) VALUES ( 'testPoly', SDO_UTIL.FROM_WKTGEOMETRY('POLYGON((-76.57418668270113 38.91891450597657 0, -76.57484114170074 38.91758725401061 0, -76.57661139965057 38.91881851059802 0, -76.57418668270113 38.91891450597657 0))'));This is producing the following error:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.RuntimeException: -2
    ORA-06512: at "MDSYS.SDO_UTIL", line 137I'm a n00b with Oracle Spatial and there's so much documentation I can't find anything that references this issue. Which usually means I have something all wrong.
    Thoughts? Help?
    Thanks so much!

    Nick,
    So does that mean the JTS download at spatialdbadvisor.com is the latest codebase you've contributed? i.e. Do I have your latest work? If not I'll redownload once you update. If so, I'll play around with the .sh script and see if I can't get it working. The current download is still called JTS. At some point the name will change, probably to something like JSC4O (Java Spatial Companion 4 Oracle)... I may drop the "Companion" but I don't want people thinking I am trying to replace SDO_GEOMETRY
    like ESRI does or Jaspa aspires to. All I want to do is make the SDO_GEOMETRY experience for users a little easier in those areas where gaps appear between releases that users need plugged but the Oracle release/license cycle isn't flexible enough.
    I often update the JTS library as I find bugs or add new functionality. For example, I release a version a few days ago which contained:
       * ST_LineMerger
       * Takes set of linestring geometries and constructs a collection of linear components
       * that form maximal-length linestrings. The linear components are returned as a MultiLineString.
       * @param p_resultSet  : RefCur_T : Ref Cursor of Linestring Geometries 
       * @param p_precision  : int   : Number of decimal places of precision when comparing ordinates.
       * @return STRUCT      : Collection of linear sdo_geometries as MultiLineString.
       * @throws SQLException
       * @history Simon Greener, January 2012, Original Coding
       * @copyright  : Licensed under a Creative Commons Attribution-Share Alike 2.5 Australia License.
       *               http://creativecommons.org/licenses/by-sa/2.5/au/
      Function ST_LineMerger(p_resultSet in &&defaultSchema..JTS.refcur_t,
                             p_precision in number)
        Return mdsys.sdo_geometry
               Deterministic;Also, I am improving/tuning my XSV exporter right now so those changes will go up.
    As each goes up I modify this page: http://www.spatialdbadvisor.com/source_code/223/geoprocessing-package-documentation
    I believe the latest version has some modifications to the install.sh script after your comments. Perhaps you might want to look at that version before starting?
    regards
    Simon

  • Geocoding Longitude Latitude Java API(s)

    Hello,
    I only need to get the longitude and latitude (no maps no nothing else) for a given address. The problem I am having is that I have about 12000 stored addresses and would like to get their corresponding longitudes and latitudes. But the free services offered by some websites allow you to retrieve only one at the time so it is time consuming.
    Does anyone know about either a trial version or some Java API(s) -so I can write my own program- to retrieve the longitude/latitude of an address?
    Thank you very much.

    This is not quite the answer, but I it is close and free of charge:
    I saw this page:
    http://www.personal.psu.edu/users/m/j/mjl284/proj6.htm
    I have looked into this, so go to
    http://www.esri.com/software/arcexplorer/index.html
    launch ARCExplorer
    Push add service and add the ESRI "Service", then add Census_TIGER2000
    Use Binoculars button to type in a street address in the area of interest.
    Zoom in and push the Identify "i" button. Click on a street.
    A window will come up with a bunch of yucky field names and values.
    Those numbers are the key. Especially note the numbers for the state and county.
    Now, go to the Tiger2000 web site. For instance, for California:
    http://www2.census.gov/geo/tiger/tiger2002/CA/
    Get the county data, for instance for Santa Clara,
    http://www2.census.gov/geo/tiger/tiger2002/CA/tgr06085.zip (about 5MB when zipped)
    Unpack the data files, which are text, and go back to the Indentify window with all the codes
    The other numbers are indices. In particular, TLID.
    The TLID for my 1/10 section of my street where my building is is 122955605
    Now, I already know that my geocode is approximately: Lat 37.391 Long. -122.068
    My address is 67 E. Evelyn Ave.
    Here is that line in those files:
    file: TGR06085.RT1, line 32046:
    11102 122955609 AE Evelyn Ave A41 100 198
    101 19900009404194041 06060850859283092830
    496704967050910950910910111013-122066172+37390040-122063872+37389240
    and now I see in in this data.
    The FNODE 6558, TNODE 6755 from the window mean that, I think, it goes from-node street address 65 to-node street address 67.
    You can go read the Census web pages for docs on the other fields.

  • J2me and Esri Map Objects

    Hello all j2me developers:
    I want to show the map of the city i live on my phone as a city guide, For this, I think using Esri map objects java edition. But I don't have enough information about this subject.If is there someone has information about this, I ask some help.
    thanx everyone
    Message was edited by:
    ahmets43
    Message was edited by:
    ahmets43

    good luck !!!
    http://www.esri.com/software/mojava/about/sys-reqs.html

  • Error while running a Java Program

    Can anyone help me,
    I am getting the following error while running a Java program, Below is the exception thrown, please help.
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Buffer.java:425)
    at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
    at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
    at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
    at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
    at org.jetel.graph.Edge.writeRecord(Edge.java:288)
    at com.tcs.re.component.RESummer1.run(RESummer1.java:505)
    java.nio.BufferOverflowException
    at java.nio.Buffer.nextPutIndex(Buffer.java:425)
    at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
    at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
    at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
    at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
    at org.jetel.graph.Edge.writeRecord(Edge.java:288)
    at com.tcs.re.component.RECollectCont.run(RECollectCont.java:304)

    Ok, let's see. Write the following class:
    public class Grunt {
      public static void main(String[] args) {
        System.out.println("Hello Mars");
    }Save it as "C:\Grunt.java", compile by typing:
    javac c:\Grunt.javaRun by typing:
    java -classpath "C:\" GruntDoes it say "Hello Mars"? If yes, go back to your program and compare for differences (maybe you used the "package" statement?).
    Regards

  • Erro de SYSFAIL e Queda do Ambiente JAVA (PI)

    Bom Dia
    Estou num projeto de NFe e atualmente esta acontecendo o seguinte cenário de Erros:
        Na SMQ2 , quando apresenta um aumento nas filas de Mensagens , aparece SYSFAIL em determinadas Filas , todas as outras travam , aumenta o numero de Filas.
       Com essa mensagem de SYSFAIL nas filas , o serve0 (Parte JAVA do PI) cai e após isso estou tendo que efetuar manualmente um STOP/START em todos os canais de comunnicação para que os R/3 voltem a emitir NFe.
        Isso esta ocorrendo com mais frequência após inserir uma nova empresa para emissão de NFe.
        Alguem poderia me ajudar a entender por que ocorre o SYSFAIL as mensagens travam e derruba o ambiente JAVA ?
    Sérgio.

    1º) Erro: Commit Fault: com.sap.aii.af.rfc.afcommunication.RfcAFWException:SenderA
    2º) Foi alterado o numero de Filas O numero de Filas foi alterado , mas não consigo ver esse parametros na RZ10 , tem  3 entradas : X32_DVEBMGS32_NFISAP ; DEFAULT ; START_DVEBMGS32_NFISAP nessa transação ...onde eu vejo isso
    3º) Esse parametro não tem nessa transação (/usr/sap//DVEBMGS00/j2ee/cluster/server0/log/). em qual desses diretórios abaixo eu encontro esse parametro ?
    Existe esses:
    DIR_ATRA      /usr/sap/X32/DVEBMGS32/data
    DIR_BINARY      /usr/sap/X32/DVEBMGS32/exe
    DIR_CCMS      /usr/sap/ccms
    DIR_CT_LOGGIN    /usr/sap/X32/SYS/global
    DIR_CT_RUN              /usr/sap/X32/SYS/exe/run
    DIR_DATA              /usr/sap/X32/DVEBMGS32/data
    DIR_DBMS              /usr/sap/X32/SYS/SAPDB
    DIR_EXECUTABLE /usr/sap/X32/DVEBMGS32/exe
    DIR_EXE_ROOT     /usr/sap/X32/SYS/exe
    DIR_GEN              /usr/sap/X32/SYS/gen/dbg
    DIR_GEN_ROOT    /usr/sap/X32/SYS/gen
    DIR_GLOBAL        /usr/sap/X32/SYS/global
    DIR_GRAPH_EXE  /usr/sap/X32/DVEBMGS32/exe
    DIR_GRAPH_LIB   /usr/sap/X32/DVEBMGS32/exe
    DIR_HOME             /usr/sap/X32/DVEBMGS32/work
    DIR_INSTALL        /usr/sap/X32/SYS
    DIR_INSTANCE     /usr/sap/X32/DVEBMGS32
    DIR_LIBRARY      /usr/sap/X32/DVEBMGS32/exe
    DIR_LOGGING     /usr/sap/X32/DVEBMGS32/log
    DIR_MEMORY_INSPECTOR   /usr/sap/X32/DVEBMGS32/data
    DIR_ORAHOME       /oracle/X32/102_64
    DIR_PAGING                            /usr/sap/X32/DVEBMGS32/data
    DIR_PUT                            /usr/sap/X32/put
    DIR_PERF                            /usr/sap/tmp
    DIR_PROFILE      /usr/sap/X32/SYS/profile
    DIR_PROTOKOLLS     /usr/sap/X32/DVEBMGS32/log
    DIR_REORG                          /usr/sap/X32/DVEBMGS32/data
    DIR_ROLL                          /usr/sap/X32/DVEBMGS32/data
    DIR_RSYN                            /usr/sap/X32/DVEBMGS32/exe
    DIR_SAPHOSTAGENT     /usr/sap/hostctrl
    DIR_SAPUSERS     ./
    DIR_SETUPS                           /usr/sap/X32/SYS/profile
    DIR_SORTTMP     /usr/sap/X32/DVEBMGS32/data
    DIR_SOURCE     /usr/sap/X32/SYS/src
    DIR_TEMP                           /tmp
    DIR_TRANS                           /usr/sap/trans
    DIR_TRFILES                          /usr/sap/trans
    DIR_TRSUB                          /usr/sap/trans

  • Starting deployment prerequisites: error in BI-Java installation sapinst

    Hi all,
    We are in process updating Bw 3.5 to BI 7.0 we hace sucessfully completed the Upgrade but while installing Bi java thru Sapinst in third step like java instance installtion  i was stck with the below error.
               We have downloaded the Cryptographic file and placed in jdk folder still the same problem is  coming.
    Please suggest...
    Thanks,
    Subhash.G
    Starting deployment prerequisites:
    Oct 13, 2007 2:42:18 AM  Error: Creation of DataSource for database "BWQ" failed.
    Original error message is:
    com.sap.sql.log.OpenSQLException: Error while accessing secure store: Encryption or decryption is not possible because the full version of the SAP Java Crypto Toolkit was not found (iaik_jce.jar is required, iaik_jce_export.jar is not sufficient) or the JCE Jurisdiction Policy Files don't allow the use of the "PbeWithSHAAnd3_KeyTripleDES_CBC" algorithm..
    Stack trace of original Exception or Error is:
    com.sap.sql.log.OpenSQLException: Error while accessing secure store: Encryption or decryption is not possible because the full version of the SAP Java Crypto Toolkit was not found (iaik_jce.jar is required, iaik_jce_export.jar is not sufficient) or the JCE Jurisdiction Policy Files don't allow the use of the "PbeWithSHAAnd3_KeyTripleDES_CBC" algorithm..

    Problem solved  followed the notes 1063396.

  • If Statement in java.awt paint

    import java.applet.Applet;  //bring in the applet class
    import java.awt.*;             //bring in the graphics class
    import java.awt.event.*;      //bring in the event class
    import java.text.DecimalFormat;    //bring in the decimal format class
    import java.lang.Float;       //bring in the float class
    public class Bmi extends Applet implements ActionListener {   //begin program and start ActionListener
      Label weight, height;    //define Label variable
      TextField weighttext, heighttext;    //define TextField variables
      Button calculate;     //define button variables
      float index, wt, ht, max, min;    //define float variables
      DecimalFormat fmt2 = new DecimalFormat("#.00"); //set decimal format for reals
    public void init() {    //begin init()
      weight = new Label("Please enter your weight in Kg. (2 decimal places): ");   //define content of Label weight
      weighttext = new TextField(6);            //define size of TextField
      height = new Label("Please enter your height in Metres (2 decimal places): ");   //define content of Label height
      heighttext = new TextField(5);    //define size of TextField
      calculate = new Button("Calculate!!");       //define content of Button
      add(weight);      //add Label weight to the GUI
      add(weighttext);   //add TextField weighttext to the GUI
      add(height);      //add Label height to the GUI
      add(heighttext);     //add TextField heighttext to the GUI
      add(calculate);        //add button calculate to the GUI
      calculate.addActionListener(this);    //wait for button to be returned
      wt = 0;     //reset wt to 0
      index = 0;  //reset index to 0
      ht = 0;      //reset ht to 0
      max = 0;      //reset max to 0
      min = 0;    //reset min to 0
      public void actionPerformed( ActionEvent e ) {   //run upon return of button
      wt = Float.parseFloat(weighttext.getText());  //convert weighttext from String to Float
      ht = Float.parseFloat(heighttext.getText());    //covert heighttext from String to Float
      repaint();     //refresh paint area
      public float indexer()  //begin indexer method
        float ind;    //delare local variable ind
        ind = wt/(ht*ht);      //perform calculation
        return ind;    //make indexer() the value of variable ind
      }  // end of indexer method
      public float maxWeight()  //begin maxWeight method
        float maxwt;    //declare local variable maxwt
        final float UPPER = 25.0f;   //declare variable UPPER as a float with a decimal value of 25.0
        maxwt = UPPER*ht*ht;      //perform calculation
        return maxwt;          //make maxWeight() the value of variable maxwt
      }  // end of maxWeight method
      public float minWeight()   //begin minWeight method
        float minwt;    //declare local variable minwt
        final float LOWER= 20.0f;   //declare variable LOWER as a float with a decimal value of 20.0
        minwt = LOWER*ht*ht;    //perform calculation
        return minwt;      //make minWeight() the value of variable minwt
      }  // end of minWeight method
    public void paint(Graphics g)    //begin paint method, define g as Graphics
        index=indexer();   //covert method indexer() to variable index
        max=maxWeight();      //convert method maxWeight() to variable max
        min=minWeight();     //convert method minWeight() to variable min
        g.setFont(new Font("Verdana", Font.ITALIC, 15));    //define font, weight and size
        g.setColor(new Color(90,90,90));     //set new colour
        g.drawRect(5,100,300,75);      //define size of rectangle
        g.setColor(new Color(255,107,9));   //set new colour
        g.drawString("BMI is " + fmt2.format(index) + " for " + fmt2.format(wt) + "kg",20,120);   //create string in paint, define its on screen position
        g.drawString("Maximum bodyweight is " + fmt2.format(max) + "kg", 20,140);   //create string in paint, define its on screen position
        g.drawString("Minimum bodyweight is " + fmt2.format(min) + "kg", 20,160);     //create string in paint, define its on screen position
      }  // end of paint method
    }    // end of Bmi classI have written the above code to calculate someones BMI (Body Mass Index). Basically as you can see it recieves a weight and height from the user and calculates the rest. But whilst that good I would like to know how I can make it tell the user something to the effect of "Your overweight" or "Your underweight". The if statement runs like this:
    if (wt > max)This forum doesn't quite handle <> properly. The greater and less than symbols. So above you will see > this is the html character code for a greater than symbol so please read it as such.
    And then if wt is greater than max then it will say "Your overweight".
    But I can't figure out how to include it in the above program. Becuase it won't run in paint, atleast it won't the way I have done it previously. So can you think of any other ways?
    Help much appreciated,
    Simon

    Thanks very much that works well.
    Simon
    My code now looks like this: import java.applet.Applet;  //bring in the applet class
    import java.awt.*;             //bring in the graphics class
    import java.awt.event.*;      //bring in the event class
    import java.text.DecimalFormat;    //bring in the decimal format class
    import java.lang.Float;       //bring in the float class
    public class Bmi extends Applet implements ActionListener {   //begin program and start ActionListener
      Label weight, height;    //define Label variable
      TextField weighttext, heighttext;    //define TextField variables
      Button calculate;     //define button variables
      float index, wt, ht, max, min;    //define float variables
      DecimalFormat fmt2 = new DecimalFormat("#.00"); //set decimal format for reals
    public void init() {    //begin init()
      weight = new Label("Please enter your weight in Kg. (2 decimal places): ");   //define content of Label weight
      weighttext = new TextField(6);            //define size of TextField
      height = new Label("Please enter your height in Metres (2 decimal places): ");   //define content of Label height
      heighttext = new TextField(5);    //define size of TextField
      calculate = new Button("Calculate!!");       //define content of Button
      add(weight);      //add Label weight to the GUI
      add(weighttext);   //add TextField weighttext to the GUI
      add(height);      //add Label height to the GUI
      add(heighttext);     //add TextField heighttext to the GUI
      add(calculate);        //add button calculate to the GUI
      calculate.addActionListener(this);    //wait for button to be returned
      wt = 0;     //reset wt to 0
      index = 0;  //reset index to 0
      ht = 0;      //reset ht to 0
      max = 0;      //reset max to 0
      min = 0;    //reset min to 0
      public void actionPerformed( ActionEvent e ) {   //run upon return of button
      wt = Float.parseFloat(weighttext.getText());  //convert weighttext from String to Float
      ht = Float.parseFloat(heighttext.getText());    //covert heighttext from String to Float
      repaint();     //refresh paint area
      public float indexer()  //begin indexer method
        float ind;    //delare local variable ind
        ind = wt/(ht*ht);      //perform calculation
        return ind;    //make indexer() the value of variable ind
      }  // end of indexer method
      public float maxWeight()  //begin maxWeight method
        float maxwt;    //declare local variable maxwt
        final float UPPER = 25.0f;   //declare variable UPPER as a float with a decimal value of 25.0
        maxwt = UPPER*ht*ht;      //perform calculation
        return maxwt;          //make maxWeight() the value of variable maxwt
      }  // end of maxWeight method
      public float minWeight()   //begin minWeight method
        float minwt;    //declare local variable minwt
        final float LOWER= 20.0f;   //declare variable LOWER as a float with a decimal value of 20.0
        minwt = LOWER*ht*ht;    //perform calculation
        return minwt;      //make minWeight() the value of variable minwt
      }  // end of minWeight method
    public void you(Graphics g)
      String statement;
      if(wt > max) statement="You are very fat";
      else if(wt < min) statement="You are very thin";
      else statement="You are in the recommended weight range for your height";
      g.drawString(statement, 20,210);
    public void paint(Graphics g)    //begin paint method, define g as Graphics
        you(g);
        index=indexer();   //covert method indexer() to variable index
        max=maxWeight();      //convert method maxWeight() to variable max
        min=minWeight();     //convert method minWeight() to variable min
        g.setFont(new Font("Verdana", Font.ITALIC, 15));    //define font, weight and size
        g.setColor(new Color(90,90,90));     //set new colour
        g.drawRect(5,100,300,75);      //define size of rectangle
        g.setColor(new Color(255,107,9));   //set new colour
        g.drawString("BMI is " + fmt2.format(index) + " for " + fmt2.format(wt) + "kg",20,120);   //create string in paint, define its on screen position
        g.drawString("Maximum bodyweight is " + fmt2.format(max) + "kg", 20,140);   //create string in paint, define its on screen position
        g.drawString("Minimum bodyweight is " + fmt2.format(min) + "kg", 20,160);     //create string in paint, define its on screen position
      }  // end of paint method
    }    // end of BmiThanks again,
    Simon

  • SSO java sample application problem

    Hi all,
    I am trying to run the SSO java sample application, but am experiencing a problem:
    When I request the papp.jsp page I end up in an infinte loop, caught between papp.jsp and ssosignon.jsp.
    An earlier thread in this forum discussed the same problem, guessing that the cookie handling was the problem. This thread recommended a particlar servlet , ShowCookie, for inspecting the cookies for the current session.
    I have installed this cookie on the server, but don't see anything but one cookie, JSESSIONID.
    At present I am running the jsp sample app on a Tomcat server, while Oracle 9iAS with sso and portal is running on another machine on the LAN.
    The configuration of the SSO sample application is as follows:
    Cut from SSOEnablerJspBean.java:
    // Listener token for this partner application name
    private static String m_listenerToken = "wmli007251:8080";
    // Partner application session cookie name
    private static String m_cookieName = "SSO_PAPP_JSP_ID";
    // Partner application session domain
    private static String m_cookieDomain = "wmli007251:8080/";
    // Partner application session path scope
    private static String m_cookiePath = "/";
    // Host name of the database
    private static String m_dbHostName = "wmsi001370";
    // Port for database
    private static String m_dbPort = "1521";
    // Sehema name
    private static String m_dbSchemaName = "testpartnerapp";
    // Schema password
    private static String m_dbSchemaPasswd = "testpartnerapp";
    // Database SID name
    private static String m_dbSID = "IASDB.WMDATA.DK";
    // Requested URL (User requested page)
    private static String m_requestUrl = "http://wmli007251:8080/testsso/papp.jsp";
    // Cancel URL(Home page for this application which don't require authentication)
    private static String m_cancelUrl = "http://wmli007251:8080/testsso/fejl.html";
    Values specified in the Oracle Portal partner app administration page:
         ID: 1326
         Token: O87JOE971326
         Encryption key: 67854625C8B9BE96
         Logon-URL: http://wmsi001370:7777/pls/orasso/orasso.wwsso_app_admin.ls_login
         single signoff-URL: http://wmsi001370:7777/pls/orasso/orasso.wwsso_app_admin.ls_logout
         Name: testsso
         Start-URL: http://wmli007251:8080/testsso/
         Succes-URL: http://wmli007251:8080/testsso/ssosignon.jsp
         Log off-URL: http://wmli007251:8080/testsso/papplogoff.jsp
    Finally I have specified the cookie version to be v1.0 when running the regapp.sql script. Other parameters for this script are copied from the values specified above.
    Unfortunately the discussion in the earlier thread did not go any further but to recognize the cookieproblem, so I am now looking for help to move further on from here.
    Any ideas will be greatly appreciated!
    /Mads

    Pierre - When you work on the sample application, you should test the pages in a separate browser instance. Don't use the Run Page links from the Builder. The sample app has a different authentication scheme from that used in the development environment so it'll work better for you to use a separate development browser from the application testing browser. In the testing browser, to request the page you just modified, login to the application, then change the page ID in the URL. Then put some navigation controls into the application so you can run your page more easily by clicking links from other pages.
    Scott

Maybe you are looking for