Validate URL with Regex in Java

Can someone please help me out with regex pattern I need to validate a URL.
Pattern for it has to be as followed.
-http://
-www.
-address
-. domain
valid http://www.yahoo.com
invalid ss.wwsa.asfvqa

Something like:
http://www\..+\..{2,4}
Might work. That's very simple and doesn't check if the last part is valid (i.e. .com, .net, etc) except for being between 2 and 4 characters. The reason is because although there are a set of very common domain names like .com and .net, there are weird ones out there like .tk.
This pattern also doesn't take into account the fact that the server might have a subdomain... i.e. http://something.website.com. It could be modified easily enough though.
Edit: Of course don't forget to escape the backslashes if you're using it in a String...
Edit #2: This also doesn't necessarily take into account international domains such as .co.uk or .co.jp.
Edited by: ProjectMoon on Feb 8, 2008 9:30 AM
Edited by: ProjectMoon on Feb 8, 2008 9:45 AM

Similar Messages

  • How to change WebAs Java URL with which it is called

    hi all,
    I am trying to activate the standard web templated for integration between BI 7.0 and EP 7.0 to execute the BEx report in Web.
    I am getting the following error:
    <b>The URL for ABAP customising table RSPOR_T_PORTAL : http://eimreymdd0.eimskip.net:50000 is not compatible with the URL  with which you call the WebAS Java : http://eimreymdd0:50000</b>
    Now, I want to change the URL of WebAS Java with which it is called.I want to change http://eimreymdd0:50000  to http://eimreymdd0.eimskip.net:50000
    How can I change this ? I want to know the location through which I can change this URL.
    Thanks in advance for your suggestion.
    Best Regards,
    Yogesh

    Hi Yogesh,
    I think you need to change you DNS server mapping.
    You can also try to change to virtual hosts property in the UME
    i.e.
    http://<host name>:<portnumber>/nwa
    Under System Management --> Configuration
    you'll find the virtual hosts.
    Regards,
    Prashil

  • Http post to a url from a WebDynpro (Java) application

    Hi,
    I want to send http post parameters to a url from a WebDynpro (Java) component. I need to do this to send OCI catalog data back to SAP SRM.
    I found this thread:
    HTTP Post
    which suggests to use the the Suspend plug for this purpose.
    <quote>
    Sending POST parameters with Web Dynpro Suspend Plugs
    1) Define a an additional Suspend Plug parameter (besides 'Url' of type String) with name 'postParams' and of type Map
    </quote>
    After adding the postParams parameter of type java.util.Map to the Suspend-plug the WebDynpro gives the following error during build:
    Outbound plug (of type 'Suspend') 'suspend_plug' may have at most two parameters: 'url' of type 'string' and 'postParams' of type 'Map'.
    I use SAP NetWeaver Developer Studio version 7.0.16.
    Does someone know a solution? I would highly appreciate it.
    Thanks in advance.
    Eric

    Hi,
    Please have a look at this thread,
    Pass Table as Input to Adaptive RFC
    Regards,
    Saravanan K

  • Converting sed regex to Java regex

    I am new to reguler expressions.I have to write a regex which will do some replacements
    If the input string is something like test:[email protected];value=abcd
    when I apply the regex on it,this string should be changed to test:[email protected];value=replacedABC
    I am trying to replace test.com and abcd with the values i have supplied...
    The regex I have come up with is in sed
    s/\(^.*@\)\(.*\)$/\1replaceTest.com;value=replacedABC/i
    Now I am trying to get the regex in Java,I would think it will be something like (^.*@\)(.*\)$\1replaceTest.com;value=replacedABC
    But not sure How i can test this.Any idea on how to make sure my java regex is valid and does the required replacements?

    rsv-us wrote:
    Yep.Agreed.
    Since that these replacements should be done in a single regex.Note that the sed replacement I posted is really made of two replacements! Just like your Java solution would.
    I think once we send this regex to the third party,they will haev to use either sed or perl(will perl do this replacements,not sure though) to get the output.
    Since we are not sure what tool/software the third party is going to use,I was trying to see how i can really test this.Then I read about sed and this regex as is didn't work,so,I had to put all the sed required / and then the regex had become like s/\(^.*@\)\(.*\)$"/1replaceTest.com;value=replacedabcd/iAgain: AFAIK that does not work. I tried it like this:
    {code}$ echo test:[email protected];value=abcd | sed 's/\(^.*@\)\(.*\)$"/1replaceTest.com;value=replacedabcd/i'and the following is returned:test:[email protected] that we will have to send the java regex to the third party,I was trying to see how i can convert this sed regex to java.If I am right,with jave regex,we won;t be able to all the finds and replacements in a single regex..right?...If this is true,this will leave me a question of whether I need to send the sed regex to the thrid party or If I send java regex,they have to convert that to either sed or perl regex.
    One more question,can we do thse replacement in perrl also,if so,what will the equivalent regex for this in perl?
    I can't understand what you are talking about. The large amount of spelling errors also doesn't help to make it clearer.
    Good luck though.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to connect with Oracle in java

    Hello!
    I would like to use java for my graduation project. And connect with Oracle in java.
    I used j2sdk1.4.2_04 and Oracle 9i release 9.2.0.1.0
    May I ask where could supply me information or content ?
    Thanks!!

    hi jus a sample code
    public class DbUtil {
    // Connection instance
    private static Connection conn = null;
    private Object connection;
    public DbUtil() {
         // Connect to the database
    dbConnect();
    * This method performs the clean up action and closes the application
    void exitDbUtil(){
    // If connected to database
    if (conn != null) {
    try {
    // Close the connection
    conn.close();
    conn=null;
    catch (Exception ex){      // Trap errors
    System.out.println(" Error while Closing the connection: "+ex.toString());
    * Creates a database connection object
    private void dbConnect() {
    try {
    String driverName = "oracle.jdbc.driver.OracleDriver";
    Class.forName(driverName);
    String url = "jdbc:oracle:thin:@" + ConnectionParams.s_hostName +
              ":" + ConnectionParams.s_portNumber +
              ":" + ConnectionParams.s_databaseSID;
    // Create a connection object
    conn = DriverManager.getConnection(url, ConnectionParams.s_userName,
                             ConnectionParams.s_password);
    catch(Exception e){

  • ACE HTTP Probe with regex

    ACE HTTP Probe with regex
    Hi,
    I'm trying to setup a HTTP probe with expected string rather then a code (config below). I do a GET for the page then a search for a string in the response however it's not working, as probe appears as failed.
    I've tested the connection to the server by using telneting and then looking at the page displayed to make sure the string I want to match is in the response.
    probe http HTTP-PROBE
    port 43050
    interval 30
    passdetect interval 30
    passdetect count 1
    request method get url /action=help
    open 43050
    expect regex action=help
    Q. Is there anything wrong with this configuration and what I'm trying to achive?
    Thanks,
    Pritesh

    Use "expect status" under probe config. expect regex doesnt work if expect status is not configured.
    expect regex work flawlessly with static pages. It doesnt work all the time with dynamic pages.
    Specially if "content-length" header is missing from Server response.
    Hope it helps
    Syed Iftekhar Ahmed

  • Problem with regex

    sorry about my english.
    i'm working with large xml file which it data like this
    (this is sample data)
    <DOCTYPE lewis SYSTEM "lewis.dtd">
    <REUTERS TOPICS="NO" LEWISSPLIT="TEST" CGISPLIT="TRAINING-SET" OLDID="20436" NEWID="21001">
    <DATE>19-OCT-1987 15:37:46.03</DATE>
    <TOPICS></TOPICS>
    <PLACES></PLACES>
    <PEOPLE></PEOPLE>
    <ORGS></ORGS>
    <EXCHANGES></EXCHANGES>
    <COMPANIES></COMPANIES>
    <UNKNOWN>
    F
    f2882reute
    f f BC-CITYFED-FINANCI   10-19 0013</UNKNOWN>
    <TEXT TYPE="BRIEF">
    ******<TITLE>CITYFED FINANCIAL CORP SAYS IT CUT QTRLY DIVIDEND TO ONE CENT FROM 10 CTS/SHR
    </TITLE>Blah blah blah.
    </TEXT>
    </REUTERS>
    <REUTERS TOPICS="YES" LEWISSPLIT="TEST" CGISPLIT="TRAINING-SET" OLDID="20435" NEWID="21002">
    <DATE>19-OCT-1987 15:35:53.55</DATE>
    <TOPICS><D>crude</D><D>ship</D></TOPICS>
    <PLACES><D>bahrain</D><D>iran</D><D>usa</D></PLACES>
    <PEOPLE></PEOPLE>
    <ORGS></ORGS>
    <EXCHANGES></EXCHANGES>
    <COMPANIES></COMPANIES>
    <UNKNOWN>
    2873reute
    r f AM-GULF-PLATFORM   10-19 0101</UNKNOWN>
    <TEXT>
    <TITLE>HUGE OIL PLATFORMS DOT GULF LIKE BEACONS</TITLE>
    <AUTHOR>    By ASHRAF FOUAD</AUTHOR>
    <DATELINE>    BAHRAIN, Oct 19 - </DATELINE><BODY>Blah blah blah
    </BODY></TEXT>
    </REUTERS>
    <REUTERS TOPICS="YES" LEWISSPLIT="TEST" CGISPLIT="TRAINING-SET" OLDID="20435" NEWID="21002">
    <DATE>19-OCT-1987 15:35:53.55</DATE>
    <TOPICS><D>ship</D></TOPICS>
    <PLACES><D>bahrain</D><D>iran</D><D>usa</D></PLACES>
    <PEOPLE></PEOPLE>
    <ORGS></ORGS>
    <EXCHANGES></EXCHANGES>
    <COMPANIES></COMPANIES>
    <UNKNOWN>
    Y
    f2873reute
    r f AM-GULF-PLATFORM   10-19 0101</UNKNOWN>
    <TEXT>
    <TITLE>LIKE BEACONS</TITLE>
    <AUTHOR>    By ASHRAF FOUAD</AUTHOR>
    <DATELINE>    BAHRAIN, Oct 19 - </DATELINE><BODY>Blah blah blah
    </BODY></TEXT>
    </REUTERS>
    <REUTERS TOPICS="YES" LEWISSPLIT="TEST" CGISPLIT="TRAINING-SET" OLDID="20435" NEWID="21002">
    <DATE>19-OCT-1987 15:35:53.55</DATE>
    <TOPICS><D>ship</D></TOPICS>
    <PLACES><D>bahrain</D><D>iran</D><D>usa</D></PLACES>
    <PEOPLE></PEOPLE>
    <ORGS></ORGS>
    <EXCHANGES></EXCHANGES>
    <COMPANIES></COMPANIES>
    <UNKNOWN>
    Y
    f2873reute
    r f AM-GULF-PLATFORM   10-19 0101</UNKNOWN>
    <TEXT>
    <TITLE>HUGE OIL PLATFORMS DOT GULF LIKE BEACONS</TITLE>
    <AUTHOR>    By ASHRAF FOUAD</AUTHOR>
    <DATELINE>    BAHRAIN, Oct 19 - </DATELINE><BODY>Blah blah blah
    </BODY></TEXT>
    </REUTERS>
    <REUTERS TOPICS="YES" LEWISSPLIT="TEST" CGISPLIT="TRAINING-SET" OLDID="20435" NEWID="21002">
    <DATE>19-OCT-1987 15:35:53.55</DATE>
    <TOPICS><D>ship</D></TOPICS>
    <PLACES></PLACES>
    <PEOPLE></PEOPLE>
    <ORGS></ORGS>
    <EXCHANGES></EXCHANGES>
    <COMPANIES></COMPANIES>
    <UNKNOWN>
    Y
    f2873reute
    r f AM-GULF-PLATFORM   10-19 0101</UNKNOWN>
    <TEXT>
    <TITLE>HUGE OIL PLATFORMS DOT GULF LIKE BEACONS</TITLE>
    <AUTHOR>    By ASHRAF FOUAD</AUTHOR>
    <DATELINE>    BAHRAIN, Oct 19 - </DATELINE><BODY>Blah blah blah
    </BODY></TEXT>
    </REUTERS>i'm try to remove article with no topic or two or more topic.
    this is my code.(sorry for not clean the code many testing in it)
    package reuterxmlextraction;
    import java.io.*;
    import java.util.ArrayList;
    import java.util.regex.Pattern;
        public static void main(String[] args) throws IOException {
            int traningcount = 0;
            int testingcount = 0;
            int notopicex = 0;
            int multitopicex = 0;
            int totaltest = 0;
            int totaltrain = 0;
            int countarticle = 0;
            String finalOutput = "";
            File rfile = new File(args[0]);
            try {
                // Open the file that is the first
                // command line parameter
                FileInputStream fstream = new FileInputStream(rfile);
                // Get the object of DataInputStream
                DataInputStream in = new DataInputStream(fstream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in), 1024 * 100);
                String strLine;
                String preOutput = "";
                ArrayList<String> preOutputmod = new ArrayList<String>();
                //Read File Line By Line
                //           while ((strLine = br.readLine()) != null) {
                //preOutput += strLine;
                //System.out.print(strLine);
                int len = (int) (rfile.length());
                byte buf[] = new byte[len];
                fstream.read(buf);
                fstream.close();
                preOutput = new String(buf);
                //System.out.println(preOutput);
                totaltest = count(preOutput, "LEWISSPLIT=\"TEST\"");
                totaltrain = count(preOutput, "LEWISSPLIT=\"TRAIN\"");
                int tempindex = 0;
                while (preOutput.indexOf("<REUTERS ", tempindex) != -1) {
                    //        while(tempindex == 0){
                    int a = preOutput.indexOf("<REUTERS ", tempindex);
                    //System.out.print(a +"\n");
                    int b = preOutput.indexOf("</REUTERS>", tempindex) + 10;
                    //System.out.print(b +"\n");
                    char pre[] = new char[b - a];
                    preOutput.getChars(a, b, pre, 0);
                    preOutputmod.add(String.valueOf(pre));
                    tempindex = b;
                    countarticle++;
                int loop = 0;
                while (loop < preOutputmod.size()) {
                    if (preOutputmod.get(loop).matches(".+<TOPICS>\\s*</TOPICS>.+")) {
                        preOutputmod.remove(loop);
                        notopicex++;
                        continue;
                    if (Pattern.matches(".+[<TOPICS>]?[<D>.+</D>]{2,}</TOPICS>.+\\s*", preOutputmod.get(loop))) {
                        preOutputmod.remove(loop);
                        multitopicex++;
                        continue;
                    } else {
                        finalOutput += preOutputmod.get(loop);
                    loop++;
            } catch (Exception e) {//Catch exception if any
                System.err.println("Error: " + e.getMessage());
            if (args[1] != null) {
                File f = new File(args[1]);
                Writer output = new BufferedWriter(new FileWriter(f));
                try {
                    //FileWriter always assumes default encoding is OK!
                    output.write(finalOutput);
                } finally {
                    output.close();
        static int count(String base, String searchFor) {
            int len = searchFor.length();
            int result = 0;
            if (len > 0) {  // search only if there is something
                int start = base.indexOf(searchFor);
                while (start != -1) {
                    result++;
                    start =
                            base.indexOf(searchFor, start + len);
            return result;
    }problem is that regex in my code don't work.
    i'm not good with regex.
    please help.
    ps.the xml i mentioned is reuter-21578 dataset total size approx 27mb

    Just saying "doesn't work" is meaningless. You need to provide details about exactly what went wrong.
    However, that's irrelevant here, since this is NOT a good job for regex. Use an XML parser.

  • Programming Cameras and Pan-Tilts with DirectX and Java

    Hi everybody!
    I am looking for the book and CD for the book "Programming Cameras and Pan-tilts with DirectX and Java", by Ioannis Pavlidis, Vassilios Morellas, Pete Roeber. Morgan Kaufmann 2003. It is out of print. I cannot find it anywhere.
    Does anyone have a copy of the CD-ROM and would be willing to sell it to me?
    Many thanks for your help and input!
    Cheers,
    WP

    can you share cd-rom?
    Or can you send me the url where I can find the cd-rom?
    agungws
    agung at gmail dot com

  • I need help with Regex, please !

    Hello,
    I would like to build the following expression: I want matcher a succession of words (e.g. separated by 1 space), but not containing a specifc word.
    Let's me give you an example to be more explicit:
    String regex = "([\\S]+ )+"; that exprisses a succession of words, but I want to supplement my regular expression (regex) to indicate that I don't want the word "MANU" for example.
    string input = "TUTU TATA TITI MANU TOTO TITI TATA MANU"
    I would like the following results:
    "TUTU TATA TITI MANU"
    "TOTO TITI TATA MANU"
    but not these one:
    "TUTU TATA TITI MANU TOTO TITI TATA MANU"
    Thank you for your answers

    Right, I forgot that the matcher would bump along and try "(?!MANU\\b)\\S+" at the second letter of each group. The solution is to use \w instead of \S, and anchor the match at the beginning of the word with \b:import java.util.regex.*;
    public class Test
      public static void main(String[] args)
        String target = "TUTU TATA TITI MANU TOTO TITI TATA MANU";
        Pattern p = Pattern.compile("(?!MANU\\b)\\b\\w+(?: (?!MANU\\b)\\b\\w+)*");
        Matcher m = p.matcher(target);
        while (m.find())
          System.out.println(m.group());
    }

  • Call report from java with deployment of java web start

    I need call report from java,the call function is:execURL ( String pURL )
    pURL is a url link to call report from report services .
    such as :http://10.20.1.43:8888/reports/rwservlet?destype=cache&desformat=PDF&report=test.rdf&user=scott/tiger@cims
    public static void execURL ( String pURL )
    String tempstr = new String();
    int posIdx = 0;
    if ( (System.getProperty("os.name").equals("Windows NT"))||
    (System.getProperty("os.name").equals("Windows 2000")) )
    posIdx = pURL.indexOf("&");
    while ( posIdx > 0 )
    tempstr = pURL.substring(0,posIdx)+"^"+pURL.substring(posIdx);
    pURL = tempstr;
    posIdx = pURL.indexOf("&",posIdx+2);
    try
    Runtime.getRuntime().exec("cmd /c start "+pURL);
    catch (Exception e1) {System.out.println(e1.getMessage()); }
    else
    try
    Runtime.getRuntime().exec("start "+pURL);
    catch (Exception e2)
    System.out.println(e2.getMessage());
    It's run with no problem with deployment of simple jar.
    But when i call report with deployment of java web start,it can not.
    I think it's java secuity problem,so i add
    Permission java.io.FilePermission "c://winnt//system32//cmd.exe", "execute";
    in java.policy file in client(windows 20000).However ,it can not too.
    Who can help me,Thanks in Advance!

    David,
    In your code, 'cmd' is invoked as Runtime.getRuntime().exec("cmd /c start "+pURL);
    but in your policy file you specify
    Permission java.io.FilePermission "c://winnt//system32//cmd.exe", "execute";
    Before creating a new process, the security manager checks for FilePermission(cmd,"execute")
    if cmd is an absolute path, otherwise it calls checkPermission with
    FilePermission("<<ALL FILES>>","execute"). Try specifying
    FilePermission("<<ALL FILES>>","execute") in your policy file.
    But, I believe using exec, may not be the right solution as it may not work on
    other platforms. Also you will have to expect the client m/c to relax security
    permission.
    Did you consider using java.net.HttpUrlConnection class instead to access the report
    service URL?
    HTH,
    Sathish.

  • URLEncoding of URLs with UTF-8 characters

    Hi,
    I'm trying to URL encode a URL with some chinese characters in them. But it isnt working properly.
    i.e. When i decode back the encdoed URL (using java.net.URLDEncoder.decode(String) & java.net.URLDecoder.decode(string) respectively), I dont get the same URL back... The chinese characters are lost some how...
    I tried writing it to a file instead of printing the out put, but no luck...
    input URL=http://down.chinamp3.com/down.php?id=70201&song_name=I%20Will%20Be%20Fine&singer_name=&#33707;&#25991;&#34074;
    encoded URL=http%3a//down.chinamp3.com/down.php%3fid%3d70201%26song_name%3dI%2520Will%2520Be%2520Fine%26singer_name%3d%e8%8e%ab%e6%96%87%e8%94%9a
    decoded URL=http://down.chinamp3.com/down.php?id=70201&song_name=I%20Will%20Be%20Fine&singer_name=���������������������
    Where as the decode URL should be same as the input URL!!!!
    I'm completely stuck, Some advice will be highly appreciated!
    Regards
    Pratim

    I tried something similar in different ways. After spending days.. i came up with something which is working fine for me in any language. I tested the following code from java applet, or input from HTML page, it seems to be working fine. I hope this helps.
    Do not use the request.getParemeter() for retrieving chinese or other 2/3 byte input characters. Instead create your own hashtable and do read ur request input stream directly.
    ------------------- code ----------------
              String queryString = request.getQueryString();
              String paramStr = "";
              if(isPost)
                   StringBuffer buffer = new StringBuffer();
                   char[] buf = new char[4 * 1024]; // 4Kchar buffer
                   int len;
                   BufferedReader reader = request.getReader();
                   while ((len = reader.read(buf, 0, buf.length)) != -1)
                        buffer.append(buf, 0 ,len);
                   paramStr = buffer.toString();
                   paramStr = URLDecoder.decode(paramStr,"UTF-8");
                   p(paramStr);
              Hashtable requestHash = createHash(paramStr);
              Hashtable getRequestHash = createHash(queryString==null?"":queryString );//HttpUtils.parseQueryString( queryString==null?"":queryString );
              for(Enumeration e= getRequestHash.keys();e.hasMoreElements();)
                   Object key = e.nextElement();
                   Object value = getRequestHash.get( key );
                   requestHash.put(key,value);
              p("Request Hash size : " + requestHash.size());
    --- end code ---
    And now the create hash function
    -------------- code -----------
    Hashtable createHash(String str)
         Hashtable hash = new Hashtable();
         StringTokenizer st = new StringTokenizer(str,"&");
         while(st.hasMoreTokens())
              StringTokenizer st1 = new StringTokenizer(st.nextToken(),"=");
              String key = st1.nextToken();
              String value = (st1.hasMoreTokens()?st1.nextToken():"");
              hash.put(key,new String[]{value});
         return hash;
    String getRequestValue(Hashtable requestHash,String key)
         if(requestHash.get(key)==null)
              return null;
         String value = ((String[]) requestHash.get(key))[0];
         return value;
    String[] getRequestValues(Hashtable requestHash,String key)
         if(requestHash.get(key)==null)
              return null;
         String[] value = ((String[]) requestHash.get(key));
         return value;
    --------------------- end code ---------------
    You can get the request value like this:
    String act=getRequestValue(requestHash,"act");
    I hope this one helps

  • Why do I have to append URL with /index.htm on one KB?

    I have 7 different KBs I maintain on my webserver. I am using RoboHelp 7. For one of them, I have to append the URL with /index.htm, or it does not show the correct information. Examples of two of the KBs, and what happens with & without the index.htm appendeden
    I will happily provide any other information. I've been wondering about this for a long time, and it's finally driven me batty enough to ask. Thanks so much for any assistance. Greatly appreciate your input, this is a wonderful resource.
    http://wpa10suppliertest.am.mot-mobility.com/ opens a training KB for supplier information. See screenshot of the WebHelp Primary Layout:
    However, for http://wpa10user.am.mot-mobility.com/ if I do not append with http://wpa10user.am.mot-mobility.com/index.htm, I get no content, and the first skin I tried out. The settings are the same:
    http://wpa10user.am.mot-mobility.com/:
    http://wpa10user.am.mot-mobility.com/index.htm:

    Hi William,
    That makes sense - but I had looked at my IIS setups and they appear the same for all KBs, again here are settings for WPA Supplier & User. I created both the same day, the same way, and have compared all tabs which are identical. I can double check on how the DNS aliases that were set up, but they should have been identical as well

  • [SOLVED] Problem with Vuze and Java RE x86_64

    Hello all !
    First of all, sorry if this issue was posted before, but find no related issue similar to mine.
    Using pacman, I successfully installed JRE (version 6u16-1-x86_64) and Vuze (version 4.2.0.8-1, former Azureus), but Vuze doesn't want to start.
    Running the Vuze's executable in the gnome-terminal, I notice messages from vuze informing it can't find Java executable ("Java exec not found in PATH, starting auto-search..." AND "OOPS, unable to locate java exec in /usr/java/latest /usr/java /usr/lib/jvm/latest /usr/lib/jvm hierarchy") and therefore cannot start the Vuze UI. I also tried but failed in verify the version of Java with the command "java -version" due to command not found.
    What is the best approach to fix this problem with Java 64 bits?
    Thanks in advance
    Last edited by josephg (2009-09-28 18:55:56)

    peart wrote:Just log out and back in, most likely.  There are scripts in /etc/profile.d/ that need to be run to set up your java environment.  They get run automatically when you log in.
    Yep, perfect answer - issue solved. Thanks a lot!

  • Problem with win2000sp3 and Java web start

    I have JRE and Java web start (1.2.0_01, build b01) which come downloading file j2re-1_4_1_01-windows-i586-i.exe from sun.
    I have win2000pro running on my PC.
    I had updated win2000 to service pack 2 and everything was fine.
    Now i decided to update to service pack 3 (in the process I also updated other components) from Microsoft and:
    1) Java applets seem to be running fine within i.e.
    2) If i try to run an application from java web start my PC freezes and I have to restart it.
    3) Staroffice 6.0, which runs on Java, seems to be fine.
    I reinstalled both sp3 and jre etc, with no result.
    Is this a known problem?
    Thanks to all.
    Maurizio

    I suspect that you have hit a known problem with Swing on Java 1.4.1 with buggy video drivers. Do you have an ATI card? They are the worst offenders. ATI released new drivers for its Radeon line today. They fix the problem.

  • Performance issue with Business Objects Java JRC API in CRXI R2 version

    A report is developed using java JRC API in CR XI release 2. When I generate the report in the designer, it took less than 5 seconds to display the results in crystal report viewer inside the designer. But in the QA environment, when I generate the same report from the application, it takes almost 1 to 1.5 minutes to display the same results in PDF. I also noticed that if the dataset contains bigger volume of data, then the reports are taking even longer almost 15 to 20 minutes.
    While generating the report from the application, I noticed that most of time is taken during the execution of the com.crystaldecisions.report.web.viewer.ReportExportControl Object method as shown in following line of code
    exportControl.processHttpRequest(request, response, context, null)
    We thought the delay in exporting the report to PDF might be the layout of the report and data conversion to PDF for such a bigger volume of data.
    Then we investigated the issue and experimented quickly to generate the same report with same result set data from the application using XML, XSL and converted the output XSL-FO to PDF using Apache FOP (Formatting Objects Processor) implementation. The time taken to export the report to PDF is less than 6 seconds. By doing this experiment, it is proved that the issue is not with conversion of data to PDF but it is the performance problem with Business Objects Java JRC API in CR XI R2.
    In this regard, I searched for the above issue in the SAP community Network Forums -> Crystal Reports and Xcelsius -> Java Development -> Crystal Reports. But I did not find any answers or solutions for this kind of issue in the forums.
    Any suggestion, hint in this matter is very much appreciated.

    Ted, The setReportAppServer problem is resolved. Now I could able to generate the report with hardcoded values in the SQLs in just 6 seconds where as the same report was generated in CRXI R2 in 1 minute 15 seconds as mentioned in the earlier message.
    But, our exisiting application passes the parameter values to the SQLs embedded in the report. For some reason the parameters are not being passed to the report and the report displays only the labels without data.
    As per the crj 12 samples codes, the code is written as shown below.
    1. Created ReportClient Document
    2. SetReportAppServer
    3. Open the report
    4. Getting DatabaseController and switching the database connection at runtime
    5. Then setting the parameters as detailed below
    ParameteFields parameterFieldController = reportClientDoc.getDataDefController().getParameterFieldController();
    parameterFieldController.setCurrentValue("", "paramname",paramvalue);
    parameterFieldController.setCurrentValue("", "paramname",paramavalue);
    byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF); 
    6. Streaming the report to the browser
    Why the parematers are not being passed to the report?  Do I need to follow the order of setting these parameters?  Did I miss any line of code for setting Params using  crj 12?
    Any help in this regard would be greatly appreciated.

Maybe you are looking for