Java crypto/ usage of keyagreemnt

hi,
i am working with JDK 1.4 and using bountsy castle provider.
i have written two methods encrypt() decrypt() using symmetric algorithem (like blowfish,AES,DES...). the encrypt() method will accept a object as parameter and writen back a sealed object.
the problem is how do i pass the key to the decrypt() method???
can i use keyagreement class???? can some one eloborate on usage of this class....

The "<h:command_button..../>" tag generates code that
is something like this:For starters, upgrade to the final release (which calls this tag commandButton, no underscore). 've no idea why anyone is still asking questions about prerelease versions!!
<input type=submit name=_id0:_id7 value="...(Save)"
onclick="document.forms['_id0']['_id0:BEName'].value='Q
otation';
document.forms['_id0']['_id0:BEName'].value='Save';
document.forms['_id0'].submit()">No, it doesn't, not in any recent version. commandLink still uses Javascript, though.
What this means is:
If i disable JavaScript usage in my browser settings
(I tested in MS IE), the above code would not work.
In considerable number of B2C web applications, Java
Script is not used because of lack of control
over Client environment (browser)Is this true? Surveys I have seen suggest that an utterly overwhelming majority of consumers have Javascript turned on.
My Question:
Does Reference Impl. of JSF (Sun) assume that Java
Script would be enabled?Yes, for the renderers delivered in the spec.
In more general terms: is it assumed that JSF-based
HTML UI requires Java Script to be enabled?No, just for the default HTML renderkit, and just for a few (currently, one) renderers in that render kit.
Can the spec team (or someone else) throw light on the
background for this technical implementation, if any?As I said, the overwhelming majority of browsers have Javascript turned on. Some components (commandLink, in particular) could not be implemented without Javascript.
-- Adam Winer (EG member)

Similar Messages

  • Java.crypto.Mac usage related to concurrency

    My first question is:
    Can I allow multiple threads to use the same instance of java.crypto.Mac concurrently? In other words, for example, is the java.crypto.Mac.doFinal(byte[] input) method thread safe?
    If the answer is no, then my second question is:
    If I have one separate instance of java.crypto.Mac per thead, in order to reuse the instance within a thread, do I have to call init(Key key) method every time before calling doFinal(byte[] input), even if the key value is always the same? I am asking this because we saw init method may introduce some overhead and we want to know whether we can avoid calling init again and again.
    Thanks a lot!
    John F

    1.The javadocs don't say, so I guess you have to assume it is not thread-safe.
    2. The javadocs do answer this, so read them.

  • SAP Java Crypto Toolkit was not found

    Hi,
    I m trying to install Netweaver 7.0 BI and portal with SR3 package. Installation is Cluster installation on windows 2008 and sql 2008 platform. When I came to Centarl instance installtion. On Start Java Phase I had the error. I put the error below. I check the notes Note 1071472 - FileSystem SecureStore connection issues, Note 914818 - JSPM: Could not detect database, Note 1154133 - JSPM: SAP Java Crypto Toolkit was not found.
    Thank you For your Help.
    Bootstrap MODE:
    <INSTANCE GLOBALS>
    determined by parameter [ID0276347].
    Exception occurred:
    com.sap.engine.bootstrap.SynchronizationException: Database initialization failed! Check database properties!
         at com.sap.engine.bootstrap.Bootstrap.initDatabaseConnection(Bootstrap.java:476)
         at com.sap.engine.bootstrap.Bootstrap.<init>(Bootstrap.java:146)
         at com.sap.engine.bootstrap.Bootstrap.main(Bootstrap.java:971)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.offline.OfflineToolStart.main(OfflineToolStart.java:81)
    ==[ Caused by: ]==----
    com.sap.engine.frame.core.configuration.ConfigurationException: Error while connecting to DB.
         at com.sap.engine.core.configuration.impl.persistence.rdbms.DBConnectionPool.<init>(DBConnectionPool.java:115)
         at com.sap.engine.core.configuration.impl.persistence.rdbms.PersistenceHandler.<init>(PersistenceHandler.java:38)
         at com.sap.engine.core.configuration.impl.cache.ConfigurationCache.<init>(ConfigurationCache.java:149)
         at com.sap.engine.core.configuration.bootstrap.ConfigurationManagerBootstrapImpl.init(ConfigurationManagerBootstrapImpl.java:236)
         at com.sap.engine.core.configuration.bootstrap.ConfigurationManagerBootstrapImpl.<init>(ConfigurationManagerBootstrapImpl.java:49)
         at com.sap.engine.bootstrap.Synchronizer.<init>(Synchronizer.java:74)
         at com.sap.engine.bootstrap.Bootstrap.initDatabaseConnection(Bootstrap.java:473)
         at com.sap.engine.bootstrap.Bootstrap.<init>(Bootstrap.java:146)
         at com.sap.engine.bootstrap.Bootstrap.main(Bootstrap.java:971)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.offline.OfflineToolStart.main(OfflineToolStart.java:81)
    Caused by: 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..
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:106)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:145)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:226)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:197)
         at com.sap.engine.core.configuration.impl.persistence.rdbms.DBConnectionPool.<init>(DBConnectionPool.java:112)
         ... 13 more
    Caused by: com.sap.security.core.server.secstorefs.NoEncryptionException: 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.
         at com.sap.security.core.server.secstorefs.SecStoreFS.openExistingStore(SecStoreFS.java:1975)
         at com.sap.sql.connect.OpenSQLConnectInfo.getStore(OpenSQLConnectInfo.java:802)
         at com.sap.sql.connect.OpenSQLConnectInfo.lookup(OpenSQLConnectInfo.java:783)
         at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:209)
         ... 15 more
    Caused by: javax.crypto.NoSuchPaddingException: Padding 'PKCS5Padding' not implemented.
         at iaik.security.cipher.w.engineSetPadding(Unknown Source)
         at iaik.security.cipher.PbeWithSHAAnd3_KeyTripleDES_CBC.<init>(Unknown Source)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at java.lang.Class.newInstance0(Class.java:308)
         at java.lang.Class.newInstance(Class.java:261)
         at javax.crypto.SunJCE_b.a(DashoA12275)
         at javax.crypto.SunJCE_b.a(DashoA12275)
         at javax.crypto.Cipher.a(DashoA12275)
         at javax.crypto.Cipher.getInstance(DashoA12275)
         at com.sap.security.core.server.secstorefs.Crypt.<init>(Crypt.java:220)
         at com.sap.security.core.server.secstorefs.SecStoreFS.<init>(SecStoreFS.java:1346)
         at com.sap.sql.connect.OpenSQLConnectInfo.getStore(OpenSQLConnectInfo.java:798)
         ... 17 more
    [Bootstrap module]> Problem occurred while performing synchronization.

    Hi
    > > Caused by: 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..
    >      at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:106)
    >      at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:145)
    >      at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:226)
    >      at com.sap.sql.connect.OpenSQLDataSourceImpl.setDataSourceName(OpenSQLDataSourceImpl.java:197)
    >      at com.sap.engine.core.configuration.impl.persistence.rdbms.DBConnectionPool.<init>(DBConnectionPool.java:112)
    It looks like the JCE file which you have downloaded is not the correct one. As you can see some jar files are missing. Check JCE files.
    Check SAP Note 1240081 - "Java Cryptography Extension Jurisdiction Policy" files
    Thanks
    Sunny

  • Compatibility between Java crypto and open ssl

    Hello
    I have some question about compatibility between java crypto and openssl library.
    This is my case:
    1.I created DESede key and stored it to file:
    SecretKey key = KeyGenerator.getInstance("TripleDES").generateKey();
    File f = new File("c:\\key.dat");
    DataOutputStream dos =new DataOutputStream(new FileOutputStream(f));
    dos.write(key.getEncoded());
    dos3.close();2.I encrypt some file "c:\\normal.dat" through:
    ecipher.init(Cipher.ENCRYPT_MODE, key2);
      byte[] enc = ecipher.doFinal(normalData);
      File f2 = new File("c:\\enc.dat");
      DataOutputStream dos =new DataOutputStream(new FileOutputStream(f2));
      dos.write(enc);
      dos.close();

    You have carefully left out some critical java code, namely the Cipher.getInstance() method. You'll notice in the documentation for this method that there 3 components to the "transform" argument of this method, the algorithm, the mode, and the padding. All of these must match exactly with the what openssl is using. Furthermore, if you are using one of the modes which require an IV, like CBC mode, then this must match exactly too. If you don't explicitly specify some of these parameters, you might get default values supplied. It is up to you to find out what these are.

  • JAVA CRYPTO TOOLKIT

    I need to install JAVA CRYPTO TOOLKIT on XI 3.0. is the Plain J2SE Adapter engine a prerequiste for Java Crypto Toolkit?

    > is the Plain J2SE Adapter engine a prerequiste for Java Crypto Toolkit.
    No. Don't get confused about the use of J2SE. J2SE means Java 2 Standard Edition and is basis for all Java Programs.
    Plain J2SE Adapter means: That adapter runs on any system where the Java library is available (in contrary to J2EE adapter which runs only on a J2EE server).
    Regards
    Stefan

  • Analysing SAP Java Memory Usage in Unix/Linux

    Hi,
    I need to analyze the SAP Java memory usage of Unix /Linux machine..NW 7.0
    Please guide with the commands and steps..complete prcedure.
    Based on it I should decide whether to create a new server node (or) increasing heap size
    Thanks in advance

    Hi,
    Do you have performance problems?
    How many CPU's are in the server?
    Did you check Log Configuration for delays or errors?
    Did you tune any exisiting parameters?
    You can add the nodes only if there is performance problems. You may think of adding one node to start with
    Proper number of server nodes within an instance:
    u2013 #ServerNodes = availableMemory / (JavaHeapPermSpaceStack)
    You can calculate the server nodes based on below formula
    No. of server Node = (RAM you want to assign or available RAM in GB)/2.5 ============> for 64-bit system
    No. of server Node = (RAM you want to assign or available RAM in GB)/1.5 ============> for 32-bit system
    Hence as per above discussion, we should go with 5 server nodes means,
    5 = RAM/2.5 (Assuming you are on 64-bit platform)
    i.e. RAM = 12.5 GB
    2). u2013 Configure JVM heap according to Note 723909 and Note 1008311 - Recommended Settings for NW 7.0 >= SR2 for the AIX JVM (J9)

  • Java heapsize usage increases while streaming messages

    Hello,
    We have created a scenario in which BlazeDS has been connected to a JMS topic. We noticed that every time a message is pushed into the JMS pipe, the Java heapsize usage increases. After we analysed a heap-dump, it appeared that the FlexClient object keeps all received message in-memory. From reading up on forums and documentation (and even bug-reports), this apparently works as desgined.
    However, we are using the flex application for some sort of always-on, always-connected display application. If the application is never switched off or disconnected, the messages that are stored in-memory just accumulate are never released anymore. Obviously this works like a time-bomb, eventually leading to an out-of-memory server-crash.
    I wonder if it is possible to change this behaviour of BlazeDS, preferrably without creating a custom queue processor. Any experts in this area that could guide me in the right direction?
    Thanks in advance!
    Cheers,
    Jan

    Jan,
    Sorry I misread your post.
    The bug I attached in the previous message is about AsyncMessage.
    I  am having the same problem as you, and I couldn't find a way to replicate this.
    The problem comes with heavy load of the server, from different sessions creating lots and lots of threads right?
    I profiled this and I've seen many and many threads blocked
    If you find a way to replicate this bug please tell me.
    I tried with a Thread that dispatches a lot of messages but it doesn't work cause blaze creates only one session for that thread.
    (in JMS mode)
    I am going to try with Jmeter.
    I really  need to know if the bug that we have can be fixed with the bug report I attached before.
    We can help each other...jejej
    Carlos.

  • Diagnostics Workload Analysis - Java Memory Usage gives BI query input

    Dears
    I have set up diagnostics (aka root cause analysis) at a customer side and I'm bumping into the problem that on the Java Memory Usage tab in Workload analyis the BI query input overview is given
    Sol Man 7.0 EHP1 SPS20 (ST component SP19)
    Wily Introscope 8.2.3.5
    Introscope Agent 8.2.3.5
    Diagnostics Agent 7.20
    When I click on the check button there I get the following:
    Value "JAVA MEMORY USAGE" for variable "E2E Metric Type Variable" is invalid
    I already checked multiple SAP Notes like the implementation of the latest EWA EA WA xml file for the Sol Man stack version.
    I already reactivated BI content using report CCMS_BI_SETUP_E2E and it gave no errors.
    The content is getting filled in Wily Introscope, extractors on Solution Manager are running and capturing records (>0).
    Did anyone come accross this issue already?
    ERROR MESSAGE:
    Diagnosis
    Characteristic value "JAVA MEMORY USAGE" is not valid for variable E2E Metric Type Variable.
    Procedure
    Enter a valid value for the characteristic. The value help, for example, provides you with suggestions. If no information is available here, then perhaps no characteristic values exist for the characteristic.
    If the variable for 0DATE or 0CALDAY has been created and is being used as a key date for a hierarchy, check whether the hierarchies used are valid for this characteristic. The same is valid for variables that refer to the hierarchy version.
      Notification Number BRAIN 643 
    Kind regards
    Tom
    Edited by: Tom Cenens on Mar 10, 2011 2:30 PM

    Hello Paul
    I checked the guide earlier on today. I also asked someone with more BI knowledge to take a look with me but it seems the root cause analysis data fetching isn't really the same as what is normally done in BI with BI cubes so it's hard to determine why the data fetch is not working properly.
    The extractors are running fine, I couldn't find any more errors in the diagnostics agent log files (in debug mode) and I don't find other errors for the SAP system.
    I tried reactivating the BI content but it seems to be fine (no errors). I reran the managed system setup which also works.
    One of the problems I did notice is the fact that the managed SAP systems are half virtualized. They aren't completely virtualized (no seperate ip address) but they are using virtual hostnames which also causes issues with Root Cause Analysis as I cannot install only one agent because I cannot assign it to the managed systems and when I install one agent per SAP system I have the message that there are already agents reporting to the Enterprise Manager residing on the same host. I don't know if this could influence the data extractor. I doubt it because in Wily the data is being fetched fine.
    The only thing that it not working at the moment is the workload analysis - java memory analysis tab. It holds the Key Performance Indicators for the J2EE engine (garbage collection %). I can see them in Wily Introscope where they are available and fine.
    When I looked at the infocubes together with a BI team member, it seemed the infocube for daily stats on performance was getting filled properly (through RSA1) but the infocube for hourly stats wasn't getting filled properly. This is also visible in the workload analysis, data from yesterday displays fine in workload analysis overview for example but data from an hour ago doesn't.
    I do have to state the Solution Manager doesn't match the prerequisites (post processing notes are not present after SP-stack update, SLD content is not up to date) but I could not push through those changes within a short timeframe as the Solution Manager is also used for other scenarios and it would be too disruptive at this moment.
    If I can't fix it I will have to explain to the customer why some parts are not working and request them to handle the missing items so the prerequisites are met.
    One of the notes I found described a similar issue and noted it could be caused due to an old XML file structure so I updated the XML file to the latest version.
    The SAPOscol also throwed errors in the beginning strange enough. I had the Host Agent installed and updated and the SAPOscol service was running properly through the Host Agent as a service. The diagnostics agent tries to start SAPOscol in /usr/sap/<SID>/SMDA<instance number>/exe which does not hold the SAPOscol executable. I suppose it's a bug from SAP? After copying the SAPOscol from the Host Agent to the location of the SMD Agent the error disappeared. Instead the agent tries to start SAPOscol but then notices SAPOscol is already running and writes in the log that SAPOscol is already running properly and a startup is not neccesary.
    To me it comes down the point where I have little faith in the scenario if the Solution Manager and the managed SAP systems are not maintained and up to date 100%. I could open a customer message but the first advice will be to patch the Solution Manager and meet the prerequisites.
    Another pain point is the fact that if the managed SAP systems are not 100% correct in transaction SMSY it also causes heaps of issues. Changing the SAP system there isn't a fast operation as it can be included in numerous logical components, projects, scenario's (CHARM) and it causes disruption to daily work.
    All in all I have mixed feelings about the implementation, I want to deliver a fully working scenario but it's near impossible due to the fact that the prerequisites are not met. I hope the customer will still be happy with what is delivered.
    I sure do hope some of these issues are handled in Solution Manager 7.1. I will certainly mail my concerns to the development team and hope they can handle some or all of them.
    Kind regards
    Tom

  • FIPS 140-2 approved java crypto library

    Hi there,
    I want to execute encryption and digital signature operations (not part of SSL or similar).
    Are there FIPS 140-2 approved java crypto libraries that I can use for free?
    Thanks

    NSS is a set of security libraries written in C so you can certainly use C APIs to access it as well. JSS is the Java interface to NSS. You can either use the JSS API directly or use Sun's PKCS11 wrapper which gives you access to most of the NSS functionalities.

  • Problem using java crypto class... Please help me

    Hi, i'm trying to do application that send information via socket, and i have to send the data encrypted,
    i`m trying to implemented the RC4 algorithm.... I read an article that said that the java sdk 1.4 has already
    implemented the securities classes. So I made this little program:
    import javax.crypto.spec.*;
    import javax.crypto.*;
    import java.security.*;
    import java.io.*;
    public class MicroRC4
    public void encriptaClavePublica(String trama)
    Cipher rc4Cipher;
    byte[] rc4KeyByte;
    SecretKey rc4Key;
    String keyStr;
    String messageEncryp;
    byte[] messageEncrypByte;
    rc4Key = null;
    messageEncryp = trama;
    // Clave para encriptar el mensaje
    keyStr = new String();
    keyStr = "12345678";
    rc4KeyByte = new byte[8];
    messageEncrypByte = new byte[255];
    for(int i=0; i < 8; i++)
    rc4KeyByte[i] = (byte)keyStr.charAt(i);
    try
    for(int i=0; i < messageEncryp.length(); i++)
    messageEncrypByte[i] = (byte)messageEncryp.charAt(i);
    rc4Key = (SecretKey)new SecretKeySpec(rc4KeyByte, "RC4");
    rc4Cipher = Cipher.getInstance("RC4");
    rc4Cipher.init(Cipher.ENCRYPT_MODE, rc4Key);
    byte[] result = null;
    result = rc4Cipher.doFinal(messageEncrypByte);
    System.out.println("Usage:"+result);
    catch(Exception e)
    System.out.println(" Error: " + e.getMessage());
    System.out.println("\n........................................\n");
    I don't know what is wrong but when i run the application it show me the following message :
    Error: Algorithm RC4 not available
    Does anybody know what is wrong ??
    Does anybody can help me ??
    or tell me when can i find some source code that implement de RC4 algorithm
    Thank's in advance..
    Alejandro.

    Hi Alejandro,
    In the ends i decided to implement the algorithm by
    myself, i did it... any way thank's again.... If
    anybody want to see the code, send me a mail......
    AlejandroCan I also get the source code? my email id is [email protected]
    Thanks a lot!
    Srik.

  • High Eden Java Memory Usage/Garbage Collection

    Hi,
    I am trying to make sure that my Coldfusion Server is optomised to the max and to find out what is normal limits.
    Basically it looks like at times my servers can run slow but it is possible that this is caused by a very old bloated code base.
    Jrun can sometimes have very high CPU usage so I purchased Fusion Reactor to see what is going on under the hood.
    Here are my current Java settings (running v6u24):
    java.args=-server -Xmx4096m -Xms4096m -XX:MaxPermSize=256m -XX:PermSize=256m -Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000 -Dsun.io.useCanonCaches=false -XX:+UseParallelGC -Xbatch ........
    With regards Memory, the only memory that seems to be running a lot of Garbage Collection is the Eden Memory Space. It climbs to nearly 1.2GB in total just under every minute at which time it looks like GC kicks in and the usage drops to about 100MB.
    Survivor memory grows to about 80-100MB over the space of 10 minutes but drops to 0 after the scheduled full GC runs. Old Gen memory fluctuates between 225MB and 350MB with small steps (~50MB) up or down when full GC runs every 10 minutes.
    I had the heap set to 2GB initally in total giving about 600MB to the Eden Space. When I looked at the graphs from Fusion Reactor I could see that there was (minor) Garbage Collection about 2-3 times a minute when the memory usage maxed out the entire 600MB which seemed a high frequency to my untrained eye. I then upped the memory to 4GB in total (~1.2GB auto given to Eden space) to see the difference and saw that GC happened 1-2 times per minute.
    Is it normal in Coldfusion that the Eden memory would grow so quickly and have garbage collection run so often? i.e do these graphs look normal?
    Also should I somehow redistribute the memory available to give the Eden memory more since it seems to be where all the action is?
    Any other advice for performance improvements would be much appreciated.
    Note: These graphs are not from a period where jrun had high CPU.
    Here are the graphs:
    PS Eden Space Graph
    PS Survivor Space Graph
    PS Old Gen Graph
    PS Perm Gen Graph
    Heap Memory Graph
    Heap/Non Heap Memory Graph
    CPU Graph
    Request Average Execution Time Graph
    Request Activity Graph
    Code Cache Graph

    Hi,
    >Is it normal in Coldfusion that the Eden memory would grow so quickly and have garbage collection run so often?
    Yes normal to garbage collect Eden often. That is a minor garbage collection.
    >Also should I somehow redistribute the memory available to give the Eden memory more since it seems to be where all the action is?
    Sometimes it is good to set Eden (Eden and its two Survivor Spaces combined make up New or Young Generation part of JVM heap) to a smaller size. I know your thinking - what make it less, but I want to make it bigger. Give less a try (sometimes less = more, bigger not = better) and monitor the situation. I like to use -Xmn switch, some sources say to use other method/s. Perhaps you could try java.args=-server -Xmx4096m -Xms4096m -Xmn172m etc. I better mention make a backup copy of jvm.config before applying changes. Having said that now you know how you can set the size to bigger if you want.
    I think the JVM is perhaps making some poor decisions with sizing the heap. With Eden growing to 1Gb then being evacuated not many objects are surviving and therefore not being promoted to Old Generation. This ultimately means the object will need to be loaded again latter to Eden rather than being referenced in the Old generation part of the heap. Adds up to poor performance.
    >Any other advice for performance improvements would be much appreciated.
    You are using Parallel garbage collector. Perhaps you could enable that to run multi-threaded reducing the time duration of the garbage collections, jvm args ...-XX:+UseParallelGC -XX:ParallelGCThreads=N etc where N = CPU cores (eg quad core = 4).
    HTH, Carl.

  • Standard Report Headings,  JAVA script usage,and  Report field fixed width

    My company has purchased Crystal Reports 2008 and I'm in the process of determining if the product will do everything we need and not become a maintenance nitemare. 
    We would like to setup some standard report headings to be used in all reports.  I've setup on already as a SUBREPORT and it works fine. We pass optional parameters that may be blank.
    We have several questions:
    1) Subreport...Once a SUBREPORT is setup as a standard heading and included in multiple reports, we are concerned about what is required if the standard heading subreport changes.  Will each report that uses this need to be opened or handled in any way to pickup the subreport changes?  Any suggestions how to handle this?
    2) Subreport....In order to get the "PAGE N of M" to work in the subreport we've setup the subreport to accept parameters that are passed from the main report and this works fine.  But this requires every report using the standard heading to setup the parameters in order to work.  Is there any other way that would minimize the setup needed for a standard heading?
    3) JAVA...  Can we call a Javascript function? If so, any hints/tips on how/where to do this?
    4) Standard Report... Creating the report is difficult with guessing the width to define to the field.  Is there a way that the report can know and display the exact size of the field being used?  A fixed field defininiton of some sort would make it MUCH easier in the layout of the report.
    5) Standard Report...We are currently testing with a stored procedure for the SQL query result data but because of the application we will need to build the query dynamically for every report.  Is there a way to bind the data and specify the field lengths? 
    6) Standard Report...When using a defined file structure I needed to add another field.  At the time it seemed like I had to start from scratch as the fields that were on the report were now gone.  Is there a update method that can be done import the changes and not loose existing fields on a report? 
    That all for now.  Sorry there are so many questions.  We are trying to clear up as many issues as we can before starting the 100+ reports needed.
    Thanks in advance.

    Hi Vitaly Izmaylov,
    I've taken your advice and split out questions 2-6 into seperate questions.  Anyone else please respond only to question 1 here. 
    I see the Re-Import subreport option....and I guess I can only assume that this means that any change to a report heading file (subreport) must be manually re-imported into every report it is used in.  There are no behind the scenes files or table that maintain a usage of these reports and can automate the population of the changes.
    I was hoping that maybe the subreports would be accessed when called for an pickup any new changes.  So if I create 100 reports with standard heading subreport, I would need to manually open and re-import that file in each report to update a report heading change.
    Does not sound real fun.
    Is all this true?
    Thanks,
    Tim

  • Install  ERP ECC 6.0 with EHP4 and JAVA stack (usage type)

    Hi all,
    I need to install ECC with EHP4 and also JAVA stack.
    I know that I have to install 2 stacks with different SID and oracle homes, firts I have to install ABAP stack and then the JAVA stack, but wich usage type should I choose for JAVA STACK?
    What I would like to have in my new installation would be the same usage type for JAVA stack like ERP 6.0 SR3 ABAP+JAVA stacks.
    What should I choose?
    Regards
    Thanks

    Hello,
    SAP ECC 6.0 allows ABAP and JAVA but EHP4 this feature is not.
    One thing I can suggest if you install ABAP stack first, it will initiates (even different SIDu2019s) the JAVA stack also.
    So JAVA stack having a protection with ABAP, because you know JAVA stack is a very sensitive and time consuming one when you want to start are stop.
    So you can do this sequence
    Suresh

  • New to java crypto

    Hi!
    I'm new to Java cryptography, and I have a problem with DES keys, here is sample app:
            String testString = "01234567";
            byte[] keyBytes = "chaslo00".getBytes("UTF-8");
            KeySpec keySpec = new DESKeySpec(keyBytes);
            SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
            SecretKey secretKey = keyFactory.generateSecret(keySpec);
            // Make bytes from DES key
            DESKeySpec spec = (DESKeySpec) keyFactory.getKeySpec(secretKey, DESKeySpec.class);
            System.out.println("key: " + new String(spec.getKey()));
            Cipher encipher = Cipher.getInstance("DES/CBC/NoPadding");
            encipher.init(Cipher.ENCRYPT_MODE, secretKey);
            byte[] raw = encipher.doFinal(testString.getBytes());
            System.out.println("encoded as base64:");
            System.out.println(new BASE64Encoder().encode(raw));
            Cipher decipher = Cipher.getInstance("DES/CBC/NoPadding");
            decipher.init(Cipher.DECRYPT_MODE,secretKey);
            byte[] decoded = decipher.doFinal(raw);
            System.out.println(new String(decoded));  I tought that I will have 01234567 as an output but, exception:
    Exception in thread "main" java.security.InvalidKeyException: Parameters missing
         at com.sun.crypto.provider.SunJCE_h.a(DashoA6275)
         at com.sun.crypto.provider.DESCipher.engineInit(DashoA6275)
         at javax.crypto.Cipher.init(DashoA6275)is thrown, what parameters are missing? I want to provide key manualy (not from random etc), how to do this? or maybe someone knows a good tutorial about this., oh one more thing - after spec.hetKey() - original key and taken from this is not the same :D any tips?
    tia Andrew

    CBC requires an IV (initialization vector). You don't have one.
    You need something like
    IvParameterSpec iv = new IvParameterSpec(ivBytes);
    with
    encipher.init(javax.crypto.Cipher.ENCRYPT_MODE, key, iv);

  • Java Crypto Exception

    Hello All -
    When I run the following program, i get the below exception. Any help would be appreciated..
    import java.security.*;
    import javax.crypto.*;
    import javax.crypto.spec.IvParameterSpec;
    import javax.crypto.spec.SecretKeySpec;
    import sun.misc.*;
    public class AESDecryption {
         /*Algorithm*/
         private static final String ALGO = "AES";
         /*Padding scheme - CBC with PKCS5Padding - Initialization Vector is used with AES*/
         private static final String ALGOParams = "/CBC/PKCS5Padding";
         /*Key byte stream*/
         private static byte[] keyValue;
         /*Initialization Vector*/
         private static byte[] iv;
         * decrypt method will take a encrypted string, key and IV in string format and
         * return the decrypted string.
         public static String decrypt(String encryptedData, String keyString, String ivString) throws Exception {
              /*convert key and IV in String format to byte array*/
              stringKeystoByteArray(keyString, ivString);
              /*Generate the key using the keyvalue specified*/
              Key key = generateKey();
              /*Get Cipher with AES/CBC/PKCS5Padding*/
              Cipher c = Cipher.getInstance(ALGO+ALGOParams);
              /*Initialize the Cipher*/
              c.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv));
              /*Decode the encrypted string using the BASE64 Decoder*/
              byte[] decordedValue = new BASE64Decoder().decodeBuffer(encryptedData);
              /*Decrypt the decoded encrypted string*/
              byte[] decValue = c.doFinal(decordedValue);
              return new String (decValue);
         * The stringKeystoByteArray method will take the comma separated, hexadecimal, String representation
         * of the key and the IV and convert each of them to byte arrays.
         private static void stringKeystoByteArray(String keyString, String ivString){
              /*Split the comma separated key and iv*/
              String keyArray [] = keyString.split(",");
              String ivArray [] = ivString.split(",");
              /*instantiate key and iv*/
              keyValue = new byte[keyArray.length];
              iv = new byte[ivArray.length];
              /*convert each hexadecimal string value to a byte and assign to key and iv*/
              for (int i=0; i< keyArray.length; i++)
                   keyValue[i] = (byte)Integer.parseInt(keyArray, 16);
              for (int i=0; i< ivArray.length; i++)
                   iv[i] = (byte)Integer.parseInt(ivArray[i], 16);           
         * Generates the Key for the Cipher
         private static Key generateKey() throws Exception {
              Key key = new SecretKeySpec(keyValue, ALGO);
              return key;
    Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:45)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:599)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa der.java:58)
    Caused by: java.lang.ExceptionInInitializerError
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
    at javax.crypto.Cipher.getInstance(Unknown Source)
    at AESDecryption.decrypt(AESDecryption.java:44)
    at AESDecryption.main(AESDecryption.java:96)
    ... 5 more
    Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
    at javax.crypto.b.<clinit>(Unknown Source)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
    ... 8 more
    Caused by: java.lang.SecurityException: Jurisdiction policy files are not signed by trusted signers!
    at javax.crypto.b.a(Unknown Source)
    at javax.crypto.b.a(Unknown Source)
    at javax.crypto.b.access$600(Unknown Source)
    at javax.crypto.b$0.run(Unknown Source)
    at java.security.AccessController.doPrivileged(AccessController.java:251 )
    ... 11 more

    You are comitting the #1 beginner's mistake in encryption. The result of encryption is a byte[] array fr good reason. It is binary data. Stringis not a container for binary data. It is a container for character data. Don't use it to hold cipher text. Use the byte[] array that the APIs already giving you.
    Also you are bamboozling yourself with all that extra exception handling. Just declare all those methods to throw GeneralSecurityException and remove the inner trys and catches completely. You also have a lot of things initialized to null and then tested for null that can never be null.
    Your code works when you fix all this.

Maybe you are looking for

  • How do I change the number formatting within a Cell Table in Microsoft Word?

    Hi, I was wondering if someone could help me out on an issue I've been having... I work for an accounting firm and we do a lot of financial statements.  I was wondering if we would be able to treat a cell table in Microsoft Word 2007 like I would a c

  • Documents in Sharepoint don't load correctly when using Windows 8.1

    Hi All, We currently have a problem with SharePoint incorrectly loading Documents when on a Windows 8 machine when the link to the document is within an iFrame or a direct link. For example: Windows 7 User clicks on a SharePoint document link (for ex

  • Names of column appearing in alv output after changing layout in alvgrid?

    Hi all I have a requirement where I am displaying 20 fields using alv grid(cl_gui_alv_grid). Now each time when I run I can change layout and can display any number of columns in output using change layout option. My requirement is i need to know the

  • Question about performance in a code.

    Hi experts... I need to make a program to make a backp of one table and the a restore. The performance of this code is fine?? The tables contain a lot of records! PARAMETERS:           p_backup    TYPE c AS CHECKBOX,           p_rest      TYPE c AS C

  • Browsing by genre / artist view

    Hi! Just upgraded to iTunes v7.0. In v6.0 I could search by genre, artist etc in the top, now I just have all my songs in the library. Is there a way to get this back? Many thanks!