Java irc bot problems

Hello,
Im trying to write a irc bot in java. So far it works well. I am trying to test
for a quiet room. If room is quiet I want my bot to say something. Only problem
is that my test for "quiet" are not working. Could someone take a look and
tell me what Im doing wrong.
Thanks,
jd
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.net.*;
import java.io.*;
import java.util.regex.*;
import java.util.Vector;
public class MySocket{
  Socket socket = null;
  BufferedReader in = null;
  PrintStream out = null;
  InetAddress inaddr = null;
  int mpt = 6667;   
public MySocket(){
  String inet_string = new String("X.X.X.X"); //ip of irc server
  Vector myConnection = makeConnection(inet_string);
  BufferedReader psIn =  (BufferedReader) myConnection.elementAt(0);
  PrintStream psOut = (PrintStream) myConnection.elementAt(1);
  String command = new String("USER " + "mohadib67854" + " 0 0 :" + "mohadib");
  cmdSend(psOut , command);
  command = "NICK " + "javabot" + " 0";
  cmdSend(psOut , command);
  command = "JOIN #bot_test";
  cmdSend(psOut , command);
  String matchString = null;
  boolean end = false;
  while(!end){
   Pattern pattern = Pattern.compile(".{1,}:End of /NAMES list.{0,}");
   try{
    matchString = psIn.readLine();
   }catch(Exception e){
    System.out.println(e);
   Matcher matcher = pattern.matcher(matchString);
   System.out.println(matchString);
   end = matcher.matches();
  //say hello
  command = "PRIVMSG #bot_test :Hello";
  cmdSend( psOut , command);
  // now go to listen and process loop
  listen(psIn , psOut);
} // close consructtor
public void listen(BufferedReader psIn , PrintStream psOut){
  boolean end = false;
  String matchString = null;
  while(!end){
   try{
    matchString = psIn.readLine();
   }catch(Exception e){
    System.out.println(e);
   // print all buffer to console
   System.out.println(matchString);
   //ping
   Pattern pattern = Pattern.compile("^PING.{1,}");
   Matcher matcher = pattern.matcher(matchString);
   boolean ping = false;
   ping = matcher.matches();
   if(ping){
    String command = new String("PONG");
    cmdSend(psOut , command);
    continue;
   // room is quite
  /* pattern = Pattern.compile("");
   matcher = pattern.matcher(matchString);
   boolean quiet = false;
   quiet = matcher.matches(); */
   if(matchString == null){
    String command = new String("PRIVMSG #bot_test :zzz");
    cmdSend(psOut , command);
    continue;
   if(matchString.equals("")){
    String command = new String("PRIVMSG #bot_test :zzz");
    cmdSend(psOut , command);
    continue;
   if(matchString.equals("\n")){
    String command = new String("PRIVMSG #bot_test :zzz");
    cmdSend(psOut , command);
    continue;
   if(matchString.equals("\r")){
    String command = new String("PRIVMSG #bot_test :zzz");
    cmdSend(psOut , command);
    continue;
   // some one said hello to javabot
   boolean hello = false;
   boolean hello_backwards = false;
   pattern = Pattern.compile("^:(.{1,})!.{0,}javabot.{0,}hello.{0,}");
   matcher = pattern.matcher(matchString);
   hello = matcher.matches();
   pattern = Pattern.compile("^:(.{1,})!.{0,}hello.{0,}javabot.{0,}");
   Matcher matcher1 = pattern.matcher(matchString);
   hello_backwards = matcher1.matches();
   if(hello){
    String name = matcher.group(1);
    String command = new String("PRIVMSG #bot_test :Hello " + name);
    cmdSend(psOut , command);
    continue;
   else if(hello_backwards){
    String name = matcher1.group(1);
    String command = new String("PRIVMSG #bot_test :Hello " + name);
    cmdSend(psOut , command);
    continue;
  } //close while
} // close listen
public void cmdSend(PrintStream out , String command){
   try{
    out.println(command);
   }catch(Exception e){
    System.out.println(e);
}// close cmdSend();
public Vector makeConnection(String inet_string){
  try{
   inaddr = InetAddress.getByName(inet_string);
   socket = new Socket(inaddr,mpt);
   in = new BufferedReader (new InputStreamReader(socket.getInputStream()), 1024 );
   out = new PrintStream (socket.getOutputStream());
  }catch(Exception e){
    System.out.println(e);
  boolean end = false;
  String myIn = null;
  while(!end){
   try{
    myIn = new String(in.readLine());   
   }catch(Exception e){
    System.out.println(e);
   Pattern pattern = Pattern.compile(".{1,}Found your hostname"); // NOTICE AUTH :*** Found your hostname
           Matcher matcher = pattern.matcher(myIn);
   System.out.println(myIn);
   end = matcher.matches();
  // put in and out in a array to return
  Vector psReturn = new Vector();
  psReturn.add(in);
  psReturn.add(out);
  return psReturn;
} // close makeConnection  
public static void main(String[] args){
    MySocket ms = new MySocket();
}

I believe what you want is a thread that waits for x seconds before doing something (ie say something). If after x seconds the thread hasnt been killed/reset then do something and reset the thread.
Your listen method should reset the thread everytime its called.
when I say reset the thread I mean the thread will be doing a wait() and when it wakes up it should check a flag to see whether or not the room is still quiet. Your listen() method should set this flag.
Thats a broad outline any hoo.
Ted.
'Standing in line to see the show tonight, theres a light on, heavy glow'

Similar Messages

  • Java IRC bot.

    hi, recently I started making an irc bot in Java. I was testing it out on my friend's server and everything seemed to be working, it was reading from the server, and was responding to the one command. I wanted to show it to my other friend so I changed the variables to match his irc server, and the bot couldn't connect. I was wondering if the problem was in my friend's server or in my code. (I'll include what the server sends when I connect at the bottom)
    package ircbot;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.util.Scanner;
    public class bot {
        public static String message;
        /* variables */
        Socket sock;
        OutputStream out;
        BufferedWriter writer;
        InputStream in;
        BufferedReader reader;
        static doaction action = new doaction();
        String nick = "Gary";
        String user = "account 8 * :oHai";
        public static String channel = "#malvager";
        String ip = "127.0.0.1"; // <-- not the actual ip...
        int port = 11235;
        /* end variable and object declarations */
        public static void main(String[] args) {
            bot superbot = new bot();
            superbot.connect();
        public void connect() {
            try {
            sock = new Socket(ip, port);
            out = sock.getOutputStream();
            writer = new BufferedWriter(new OutputStreamWriter(out));
            in = sock.getInputStream();
            reader = new BufferedReader(new InputStreamReader(in));
            join(nick, channel, user, writer, reader);
            } catch (UnknownHostException e) {
                e.printStackTrace();
            } catch (IOException i) {
                i.printStackTrace();
            }// end try/catch
        public static void join(String nick, String channel, String user, BufferedWriter writer, BufferedReader reader) {
            try {
                writer.write("NICK " + nick);
                System.out.println("set nick");
                writer.newLine();
                writer.flush();
                System.out.println(reader.readLine());
                writer.write("USER " + user);
                System.out.println("set user");
                writer.newLine();
                writer.flush();
                System.out.println(reader.readLine());
                writer.write("JOIN " + channel);
                System.out.println("joined channel");
                writer.newLine();
                writer.flush();
                System.out.println(reader.readLine());
                read(reader, writer);
            } catch (IOException e) {
                e.printStackTrace();
        public static void read(BufferedReader reader, BufferedWriter writer) {
            String said;
            while(1 == 1) {
                try {
                    said = reader.readLine();
                    System.out.println(said);
                    if (check(said) == true) {
                        print(writer);
                } catch (IOException f) {
                    f.printStackTrace();
        public static boolean check(String input) {
            message = action.setinput(input);
            if (message.equals("I'm awesome")) {
                return(true);
            } else {
                return(false);
        public static void print(BufferedWriter writer) {
            Scanner input = new Scanner(System.in);
           try {
               writer.write("PRIVMSG " + channel + " " + message);
               writer.newLine();
               writer.flush();
           } catch(IOException r) {
               r.printStackTrace();
    }// end class
    package ircbot;
    import java.lang.String;
    public class doaction {
        public String setinput(String input) {
            int length = input.length();
            int control;
            String message = input;
            control = length - 5;
            message = message.substring(control, length);
            if (message.equals("!Gary")) {
                message = "I'm awesome";
                return(message);
            } else {
                message = input;
                return("bad");
    }When I connect to my second friend's server (the one that doesn't work) I get:
    set nick
    :lolnepp.no-ip.biz NOTICE AUTH :*** Looking up your hostname...
    set user
    :lolnepp.no-ip.biz NOTICE AUTH :*** Found your hostname (cached)
    joined channel
    PING :51AA6A7F
    :lolnepp.no-ip.biz 451 JOIN :You have not registered
    When I connect to the friend's server that works I get:
    set nick
    :Malvager.hub NOTICE AUTH :*** Looking up your hostname...
    set user
    :Malvager.hub NOTICE AUTH :*** Found your hostname
    joined channel
    :Malvager.hub 001 Gary :Welcome to the Malvager-IRC-Network IRC Network [email protected]
    :Malvager.hub 002 Gary :Your host is Malvager.hub, running version Unreal3.2.7
    :Malvager.hub 003 Gary :This server was created Sun Oct 26 2008 at 00:01:26 PDT
    :Malvager.hub 004 Gary Malvager.hub Unreal3.2.7 iowghraAsORTVSxNCWqBzvdHtGp
    Okay yea, can anyoen tell me if the problem is in my code or the server? And if the problem is in the code could you please tell me what to change or point me in the right directin? thanks.

    kajbj wrote:
    youngdeveloper wrote:
    What do you mean it doesn't look like a java program..? Sorry, I was watching tv while I was typing. It should say "Java problem" and not "Java program" :)
    And yea, I realize it says that, but the steps to register are you enter the nick and the user which both come before that, so I was wondering if anyone with knowledge of how irc works could tell me if there's some other way of registering, or if the problem's in my code.Some IRC servers requires that an admin in the channel creates the user account.
    KajOkay, glad to know it was supposed to say program :).
    I'm pretty sure that it's not because the admin has to set up the acc. because this server was set up with the sole purpose of showing my friend my bot. However, it might be just that the server is retarded. I'm gonna try it on some other servers and see how it works there.

  • IRC Bot/Virus- is this possible on a mac?

    Hello all
    I'm hoping someone can help me with a little problem I am having. My service provider (Rogers cable) is claiming that one of my computers has contracted an "IRC Bot/Virus" (I have three imacs and 1 ibook on my network). I thought this was a windows virus. Is it even possible that one of my macs has this virus? If so, How do I get rid of it?
    Maybe they are just trying to get me to buy the anti virus software or something?
    Any help or insight would be welcome.

    Hello Mr.light,
    it is possible that a kind of unix program was installed on your mac, usually IRC-bots. My own experience is that my dutch ISP has shut me (partly) off because of abnormal outgoing IRC traffic. In my case 'they' cracked my password and installed psyBNC. on my Mac with OS X 10.3.9. With this program they can easy hide there activities on the net. psyBNC automagically connects to a certain IRC channel so the hackers can use your internetconnection to do their malicious work. The operators of the channels are most likey also the installers of this kind of software.
    U can monitor outgoing traffic with 'Little Snitch'. Most likely the IRC-bot runs as a process without a name or under a different name, use the Activity Monitor (in Utilities) to look for strange processes, google the names of the processes.
    also use Console (in Utilities) to read the 'Secure.log"
    Cracking of passwords is easy when you are running an ftp server, in combination with short or easy passwords and loginnames and with a bad configurated firewall or router

  • My iMac infected with "IRC Bot/Virus" So How can I Resolve this ?

    I Received Rogers EUA Team Notice say that one or more the computers in your home connected to Rogers Internet services appears to be infected with an " IRC BOT/Virus" So How can I Resolve this problem I just bought this I-mac over 1 yr Thanks
    iMac (27-inch Mid 2011)
    Also I have a PC but I already use Virus scanner (Rogers Online Protection) say no found.

    It seems this is just Rogers sending this to any client that as not installed the anti virus software they offer.
    That virus is Windows only, so it can't be running on your Mac.
    But could be on Windows if you are using boot camp.
    If this is not your case, just ignore the message from Rogers.
    See this thread about the same problem.
    https://discussions.apple.com/message/5882162?messageID=5882162#5882162?messageI D=5882162

  • Sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loop

    sir i have given lot of effort but i am not able to solve my problem either with notifiers or with occurence fn,probably i do not know how to use these synchronisation tools.

    sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loopHi Sam,
    I want to pass along a couple of tips that will get you more and better response on this list.
    1) There is an un-written rule that says more "stars" is better than just one star. Giving a one star rating will probably eliminate that responder from individuals that are willing to anser your question.
    2) If someone gives you an answer that meets your needs, reply to that answer and say that it worked.
    3) If someone suggests that you look at an example, DO IT! LV comes with a wonderful set of examples that demonstate almost all of the core functionality of LV. Familiarity with all of the LV examples will get you through about 80% of the Certified LabVIEW Developer exam.
    4) If you have a question first search the examples for something tha
    t may help you. If you can not find an example that is exactly what you want, find one that is close and post a question along the lines of "I want to do something similar to example X, how can I modify it to do Y".
    5) Some of the greatest LabVIEW minds offer there services and advice for free on this exchange. If you treat them good, they can get you through almost every challenge that can be encountered in LV.
    6) If English is not your native language, post your question in the language you favor. There is probably someone around that can help. "We're big, we're bad, we're international!"
    Trying to help,
    Welcome to the forum!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Re   Java Stored Procedure Problem

    Ben
    There appear to be some problem with the forum. It doesn't want to show my response to your post with the subject "Java Stored Procedure Problem". See the answer to this thread for an example of how to do this...
    Is there a SAX parser with PL/SQL??

    Ben
    There appear to be some problem with the forum. It doesn't want to show my response to your post with the subject "Java Stored Procedure Problem". See the answer to this thread for an example of how to do this...
    Is there a SAX parser with PL/SQL??

  • "How to Resolve ORA-29532 Java 2 Permission Problems in RDBMS 8.1.6 and 8.1.7"

    I'm in the process of publishing the following note (134280.1), titled "How to Resolve ORA-29532 Java 2
    Permission Problems in RDBMS 8.1.6 and 8.1.7".
    It will be accessible from Oracle Support's "Metalink" site.
    "How to Resolve ORA-29532 Java 2 Permission Problems in RDBMS 8.1.6 and 8.1.7".
    Problem Description
    Periodically an application running in the Enterprise Java Engine
    (EJE) formerly known as the "Oracle 8i JVM", "the JSERVER component", or
    the "Aurora JVM" will fail with a "java 2" permissions error having the
    following format :
    Note : Message shown below have been reformatted for easier readability.
    java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java exception:
    usually followed by a detailed error message similar to one of the following
    messages :
    Example # 1
    java.security.AccessControlException: the Permission
    (java.net.SocketPermission hostname resolve)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
    Example # 2
    java.security.AccessControlException: the Permission
    (java.util.PropertyPermission * read,write)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
    Example # 3
    java.security.AccessControlException: the Permission
    (java.io.FilePermission \matt1.gif read)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(SCOTT|PolicyTableProxy(SCOTT))
    Explanation
    The java 2 permission stated in line # 2 of each of the above "Examples"
    has not been granted to the user specified in line 4 of the above "Examples".
    Solution Description
    The methodology to solve this issue is identical for all java 2 permissions
    cases.
    1) Format a call "dbms_java.grant_permission" procedure as described below.
    2) Logon as SYS or SYSTEM
    3) Issue the TWO commands shown below
    4) Logoff as SYS or SYSTEM
    5) Retry your application
    For Example # 1
    1) Logon as SYS or SYSTEM
    2) Issue the following commands :
    a) call dbms_java.grant_permission('SCOTT',
    'java.net.SocketPermission',
    'hostname',
    'resolve');
    b) commit;
    Note: Commit is mandatory !!
    3) Logoff as SYS or SYSTEM
    4) Retry your application
    For Example # 2
    1) Logon as SYS or SYSTEM
    2) Issue the following commands :
    a) call dbms_java.grant_permission('SCOTT',
    'java.util.PropertyPermission',
    'read,write');
    b) commit;
    Note: Commit is mandatory !!
    3) Logoff as SYS or SYSTEM
    4) Retry your application
    For Example # 3
    1) Logon as SYS or SYSTEM
    2) Issue the following commands :
    a) call dbms_java.grant_permission('SCOTT',
    'java.io.FilePermission',
    '\matt1.gif',
    'read');
    b) commit;
    Note: Commit is mandatory !!
    3) Logoff as SYS or SYSTEM
    4) Retry your application
    References
    For more details on java 2 permissions and security within the EJE, review
    Chapter 5, in the Java Developer's Guide. entitled,
    "Security For Oracle8i Java Applications"
    The RDBMS 8.1.7 version can be found at :
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/index.htm

    Hi, Don,
    I solved the problem of security exception I mentioned at java procedure topic as following:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.SecurityException
    I tried to use your solution as following:
    call dbms_java.grant_permission('SDE', 'java.net.SocketPermission', 'ORCL.COHPA.UCF.EDU','resolve');
    but SQL*plus gave me a error message:
    invalid collumn.
    What's the problem?
    However, I call a grant command as following:
    SQL> grant JAVASYSPRIV to sde;
    and then that exception is gone. What's the difference between dbms_java.grant_permission and grant command?
    Thanks
    Bing
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by don -- oracle support:
    I'm in the process of publishing the following note (134280.1), titled "How to Resolve ORA-29532 Java 2
    Permission Problems in RDBMS 8.1.6 and 8.1.7".
    It will be accessible from Oracle Support's "Metalink" site.
    "How to Resolve ORA-29532 Java 2 Permission Problems in RDBMS 8.1.6 and 8.1.7".
    Problem Description
    <HR></BLOCKQUOTE>
    null

  • IRC compilation problem

    import org.jibble.pircbot.*;
    import com.sun.speech.freetts.*;
    import com.sun.speech.freetts.audio.*;
    import javax.sound.sampled.*;
    import java.io.File;
    public class SpeechBot extends PircBot {
        private Voice voice;
        public SpeechBot(String name) {
            setName(name);
            // Choose the voice for the speech synthesizer.
            String voiceName = "kevin16";
            VoiceManager voiceManager =
    VoiceManager.getInstance();
            voice = voiceManager.getVoice(voiceName);
            if (voice == null) {
                System.out.println("Voice not found.");
                System.exit(1);
            voice.allocate();
            // Set up the output format.
            AudioPlayer voicePlayer = new JavaClipAudioPlayer();
            voicePlayer.setAudioFormat(new AudioFormat(8000,
    16, 1, false, true));
            voice.setAudioPlayer(voicePlayer);
        public void onMessage(String channel, String sender,
    String login, String hostname, String message) {
            // Send all IRC messages to the voice
    synthesizer.
            message = message.trim();
            String input = sender + " on " + channel + "
    says: " + message;
            voice.speak(input);
        public static void main(String[] args) throws
    Exception {
            if (args.length < 2) {
                System.out.println("Usage: java SpeechBot
    <server> <channel>");
                System.exit(1);
            SpeechBot bot = new SpeechBot("SpeechBot");
            bot.connect(args[0]);
            bot.joinChannel(args[1]);
    }This is my code,i have downloaded all the jar files needed for it,but its not getting compiled
    please tell me the correct statement of the compilation.......

    In your last thread (which you crossposted around) I told you that you need to spend some time with the networking tutorials. Perhaps you really need to spend time with the basic Java tutorials instead?
    There are a bunch of problems with this post anyway like
    1) It doesn't belong in this forum, but most likely New to Java or Java Programming. Simple compilation problems go into those forums.
    2) You didn't provide the most important information anyway. The statement "its not getting compiled" tells us nothing. It's totally useless.
    3) Posting about problems with third-party libaries as you are here is also discouraged. You should ask the people/person who wrote the class for help
    But again, based on both this and your previous thread, it seems pretty clear to me that you are attempting to bite off far more than you can know chew. If you are student trying to learn, again I urge you to stop and spend a good amount of time with the basic Java tutorials. Learn how basic Java code is structured and how to solve simple classpath and syntax compilation errors. If you are employed then you got this job by lying so my advice to you would be to quit. You're at least 6 months away from being safe to let work on any code.

  • 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

  • Unable to Launch Integration Builder: Java Web Start problem

    Hi,
    I am unable to launch the integration builder. I am using JDK 1.4.2_05. The java Web Start gives the following error:
    Unsigned application requesting unrestricted access to system
    Unsigned resource: http://<XIHostName>:50000/rep/repository/aii_util_rb.jar
    I have tried deleting the Java web start cache, and even reinstalling the JDK.
    Can someone suggest a workaround this problem ?
    thanks,
    Manish

    The Java Web Start cannot accept unsigned jars. If the jars are signed, it will ask in a dialog box if it should allow unrestricted access to this jar.
    In my case, I upgraded XI SP0 to SP4, which included updating the Adapter Core, Adapter Framework, and the XI TOOLS to SP4.
    On launching the Web start, it seemed that the jars were not getting signed. JWS cannot allow unsigned jars to the client.
    These jars are maintained in:
    \usr\sap\<SID>\SYS\global\xi\directory_server\javaws\directory
    I am having problems with my XI upgrade to SP4, and it is probably not signing the jars.
    Do you know why this may be happening ...
    thanks,
    Manish

  • Java Webstart application problem with TLS certificate revocation checks (Java 1.7.0_76)

    We have a problem with our Java Web Start Application regarding the TLS certificate revocation check:
    The application is running on a server within a wide area network which is separated from the internet.
    The application users have access to the WAN, and also access to the internet over some corporate proxy/firewall.
    The user has to enter, for example "https://my-site.de/myapp/ma.jnlp" within a webbrowser or could also call  "javaws https://my-site.de/myapp/ma.jnlp" to start the application client.
    The webserver has a certificate from a trusted certificate authority. This certificate seems to be ok, the browser is even configured to perform OCSP status check.
    The application files are signed with a certificate from another trusted certificate authority. This certificate seems also to be ok. Regarding this certificate there
    are no problems with certificate revocation checks.
    The problem is, while starting the application client there is a message box which tell us something like "the connection to this website ist not trustworthy",
    "Website: https://my-site.de:80", and something about an invalid certificate, meaning the webserver certificate.
    Obviously the jvm runtime, which is executed on the users workstation, tries to perform a revocation check for the webservers certificate, but this fails because
    it cannot fetch the certificate under https://my-site.de:80.
    The application will execute without further problems after that message but the users are very concerned about the "invalid" certificate, so here are my questions:
    - Why is the application trying to get the webserver certificate over Port 80. Our application developers told me, there is no corresponding statement. Calling this address
      has to fail while "https://my-site.de:443" or "https://my-site.de" would not have a problem.
    - Is there a way to make the application go on without performing a tls revocation check? I mean, by adjusting the application sourcecode and not by configuring the users Java Control Panel.
      While disabling the TLS Certificate Revocation check in the Java Control Panel, the Webstart Application executes without a warning message, but this is not a workable solution for
      our users.
    It would be great if someone can help me with a hint so i can send our developers into the right direction;-)
    Many thanks!
    This is a part from a java console output after calling "javaws -verbose https://my-site.de/myapp/"
    (sorry for this is in german... and also my english above)
    network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    security: OCSP Response: GOOD
    network: Verbindung von http://ocsp.serverpass.telesec.de/ocspr mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    security: UNAUTHORIZED
    security: Failing over to CRLs: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
    network: Cacheeintrag gefunden [URL: http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl, Version: null] prevalidated=false/0
    cache: Adding MemoryCache entry: http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl
    cache: Resource http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl has expired.
    network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird hergestellt
    network: ResponseCode für http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl: 200
    network: Codierung für http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl: null
    network: Verbindung mit http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl trennen
    CacheEntry[http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl]: updateAvailable=true,lastModified=Tue Mar 24 10:50:01 CET 2015,length=53241
    network: Verbindung von http://crl.serverpass.telesec.de/rl/TeleSec_ServerPass_CA_1.crl mit Proxy=HTTP @ internet-proxy.***:80 wird
    network: Verbindung von socket://ldap.serverpass.telesec.de:389 mit Proxy=DIRECT wird hergestellt
    security: Revocation Status Unknown
    com.sun.deploy.security.RevocationChecker$StatusUnknownException: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
        at com.sun.deploy.security.RevocationChecker.checkOCSP(Unknown Source)
        at com.sun.deploy.security.RevocationChecker.check(Unknown Source)
        at com.sun.deploy.security.RevocationCheckHelper.doRevocationCheck(Unknown Source)
        at com.sun.deploy.security.RevocationCheckHelper.doRevocationCheck(Unknown Source)
        at com.sun.deploy.security.RevocationCheckHelper.checkRevocationStatus(Unknown Source)
        at com.sun.deploy.security.X509TrustManagerDelegate.checkTrusted(Unknown Source)
        at com.sun.deploy.security.X509Extended7DeployTrustManagerDelegate.checkServerTrusted(Unknown Source)
        at com.sun.deploy.security.X509Extended7DeployTrustManager.checkServerTrusted(Unknown Source)
        at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
        at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
        at sun.security.ssl.Handshaker.processLoop(Unknown Source)
        at sun.security.ssl.Handshaker.process_record(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
        at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
        at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
        at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.checkUpdateAvailable(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.isUpdateAvailable(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
        at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
        at com.sun.deploy.model.ResourceProvider.getResource(Unknown Source)
        at com.sun.javaws.jnl.LaunchDescFactory._buildDescriptor(Unknown Source)
        at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
        at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
        at com.sun.javaws.Main.launchApp(Unknown Source)
        at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
        at com.sun.javaws.Main.access$000(Unknown Source)
        at com.sun.javaws.Main$1.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        Suppressed: com.sun.deploy.security.RevocationChecker$StatusUnknownException
            at com.sun.deploy.security.RevocationChecker.checkCRLs(Unknown Source)
            ... 35 more
    Caused by: java.security.cert.CertPathValidatorException: OCSP response error: UNAUTHORIZED
        at sun.security.provider.certpath.OCSP.check(Unknown Source)
        at sun.security.provider.certpath.OCSP.check(Unknown Source)
        at sun.security.provider.certpath.OCSP.check(Unknown Source)
        ... 36 more
    security: Ungültiges Zertifikat vom HTTPS-Server
    network: Cacheeintrag nicht gefunden [URL: https://my-site.de:80, Version: null]

    Add the JSF Jars to the WEB-INF/lib directory of the application. If still getting error add to the CLASSPATH variable in the startWebLogic script in the domain/bin directory.

  • Java Swing application problem in Windows vista

    When we execute the Swing application in windows vista environment.
    The look and feel of the swing components are displayed improperly.
    Do we need to put any specific look and feel for windows vista environment or any specific hardware configuration is required to setup windows vista environment.
    Please give some inputs to solve the problem.
    We have tried with the following sample code to run in windows vista.
    * Vista.java
    * Created on December 5, 2006, 5:39 PM
    public class Vista extends javax.swing.JFrame {
    /** Creates new form Vista */
    public Vista() {
    initComponents();
    pack();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
    jButton1 = new javax.swing.JButton();
    jToggleButton1 = new javax.swing.JToggleButton();
    jPanel1 = new javax.swing.JPanel();
    jCheckBox1 = new javax.swing.JCheckBox();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jTextField1 = new javax.swing.JTextField();
    getContentPane().setLayout(null);
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jButton1.setText("Button 1");
    getContentPane().add(jButton1);
    jButton1.setBounds(20, 20, 170, 30);
    jToggleButton1.setText("Togle btn");
    getContentPane().add(jToggleButton1);
    jToggleButton1.setBounds(100, 80, 90, 20);
    jPanel1.setLayout(null);
    jCheckBox1.setText("jCheckBox1");
    jCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jPanel1.add(jCheckBox1);
    jCheckBox1.setBounds(10, 40, 130, 13);
    getContentPane().add(jPanel1);
    jPanel1.setBounds(10, 150, 200, 130);
    jTextArea1.setColumns(20);
    jTextArea1.setRows(5);
    jScrollPane1.setViewportView(jTextArea1);
    getContentPane().add(jScrollPane1);
    jScrollPane1.setBounds(210, 150, 164, 94);
    jTextField1.setText("jTextField1");
    getContentPane().add(jTextField1);
    jTextField1.setBounds(240, 30, 140, 30);
    pack();
    }// </editor-fold>//GEN-END:initComponents
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new Vista().setVisible(true);
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JToggleButton jToggleButton1;
    // End of variables declaration//GEN-END:variables
    }

    When we execute the Swing application in windows
    vista environment.
    The look and feel of the swing components are
    displayed improperly.Improperly means what? You must be aware that Vista's native L&F certainly isn't supported yet.

  • Java Threads compilation problem

    Hi everyone,
    I've having problems getting a simple thread program to compile, the programs says " ; " expected when there is already one present. I've gone through the program many times and still can't put my finger on whats going wrong. If someone could take a quick look and if possible tell me where I am going wrong.
    Many Thanks
    Its class ThreadA that will not compile
    ***code********************************************
    public class ThreadA extends Thread
    private int id;
    public ThreadA(int i) (id = i);
    public void run()
    for (int i=0}; i < 10; i++);
    try {sleep(1000};)catch (InterruptedException e)();
    System.out.println("Output from Thread " + id);
    import java.io.*;
    public class TestThreads1
    public static void main (String args [] )
    Thread t1 = new ThreadA (1);
    Thread t2 = new ThreadA (2);
    Thread t3 = new ThreadA (3);
    t1.start();
    t2.start();
    t3.start();
    **code***********************************************************

    public class ThreadA extends Thread
    private int id;
    public ThreadA(int i) (id = i); // <-- problem
    public void run()
    for (int i=0}; i < 10; i++); // <-- two problems
    try {sleep(1000};)catch (InterruptedException e)(); // <-- more problems
    System.out.println("Output from Thread " + id);
    }

  • Java/Active Directory problem

    I have a strange problem. We have an application that we login to through a website. The application requires Java 1.42_9 to run properly. These workstations came from Dell with java 1.50_6 preloaded which I removed infavor of the required 1,42_9. Everything works normally when a user logs into the the workstation (WinXP SP2) as the local adminstrator. The problem arises when a user logs into the machine with an Active Directory account. We trying to run the website to login to our application and all we get is the Red X in the upper left hand corner of the screen. There is nothing in the Java console, it seems like java does not even attempt to start. I am not sure what Active Directory has to do with this but as long as we log in as a local admin everything works great. If I load Java 1.50_6 back on the workstation it works but it takes over two minutes for Java to load which is unacceptable. I have also tried 1.50_7 but it too take too long to load.
    Sorry for the long winded post, but Im hoping someone has suggestions on why logging into Active directory causes 1.42_9 to fail.

    Your problem is your use of these two combinations
    constrains.setSearchScope(SearchControls.SUBTREE_SCOPE);
    ctx.search("", "(objectclass=*)", constrains); Many LDAP servers, including Active Directory, do not permit subtree searches from the root.

  • PL/SQL Procedure Calling Java Host Command Problem

    This is my first post to this forum so I hope I have chosen the correct one for my problem. I have copied a java procedure to call Unix OS commands from within a PL/SQL procedure. This java works well for some OS commands (Eg ls -la) however it fails when I call others (eg env). Can anyone please give me some help or pointers?
    The java is owned by sys and it looks like this
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ExecCmd" AS
    //ExecCmd.java
    import java.io.*;
    import java.util.*;
    //import java.util.ArrayList;
    public class ExecCmd {
    static public String[] runCommand(String cmd)
    throws IOException {
    // set up list to capture command output lines
    ArrayList list = new ArrayList();
    // start command running
    System.out.println("OS Command is: "+cmd);
    Process proc = Runtime.getRuntime().exec(cmd);
    // get command's output stream and
    // put a buffered reader input stream on it
    InputStream istr = proc.getInputStream();
    BufferedReader br = new BufferedReader(new InputStreamReader(istr));
    // read output lines from command
    String str;
    while ((str = br.readLine()) != null)
    list.add(str);
    // wait for command to terminate
    try {
    proc.waitFor();
    catch (InterruptedException e) {
    System.err.println("process was interrupted");
    // check its exit value
    if (proc.exitValue() != 0)
    System.err.println("exit value was non-zero: "+proc.exitValue());
    // close stream
    br.close();
    // return list of strings to caller
    return (String[])list.toArray(new String[0]);
    public static void main(String args[]) throws IOException {
    try {
    // run a command
    String outlist[] = runCommand(args[0]);
    for (int i = 0; i < outlist.length; i++)
    System.out.println(outlist);
    catch (IOException e) {
    System.err.println(e);
    The PL/SQL looks like so:
    CREATE or REPLACE PROCEDURE RunExecCmd(Command IN STRING) AS
    LANGUAGE JAVA NAME 'ExecCmd.main(java.lang.String[])';
    I have granted the following permissions to a user who wishes to run the code:
    drop public synonym RunExecCmd
    create public synonym RunExecCmd for RunExecCmd
    grant execute on RunExecCmd to FRED
    grant javasyspriv to FRED;
    Execute dbms_java.grant_permission('FRED','java.io.FilePermission','/bin/env','execute');
    commit
    Execute dbms_java.grant_permission('FRED','java.io.FilePermission','/opt/oracle/live/9.0.1/dbs/*','read, write, execute');
    commit
    The following test harness has been used:
    Set Serverout On size 1000000;
    call dbms_java.set_output(1000000);
    execute RunExecCmd('/bin/ls -la');
    execute RunExecCmd('/bin/env');
    The output is as follows:
    SQL> Set Serverout On size 1000000;
    SQL> call dbms_java.set_output(1000000);
    Call completed.
    SQL> execute RunExecCmd('/bin/ls -la');
    OS Command is: /bin/ls -la
    total 16522
    drwxrwxr-x 2 ora9sys dba 1024 Oct 18 09:46 .
    drwxrwxr-x 53 ora9sys dba 1024 Aug 13 09:09 ..
    -rw-r--r-- 1 ora9sys dba 40 Sep 3 11:35 afiedt.buf
    -rw-r--r-- 1 ora9sys dba 51 Sep 3 09:52 bern1.sql
    PL/SQL procedure successfully completed.
    SQL> execute RunExecCmd('/bin/env');
    OS Command is: /bin/env
    exit value was non-zero: 127
    PL/SQL procedure successfully completed.
    Both commands do work when called from the OS command line.
    Any help or assistance would be really appreciated.
    Regards,
    Bernard.

    Kamal,
    Thanks for that. I have tried to use getErrorStream and it does give me more info. It appears that some of the commands cannot be found. I suspected that this was the case but I am not sure about how this can be as they all appear to reside in the same directory with the same permissions.
    What is more confusing is output like so:
    SQL> Set Serverout On size 1000000;
    SQL> call dbms_java.set_output(1000000);
    Call completed.
    SQL> execute RunExecCmd('/usr/bin/id');
    OS Command is: /usr/bin/id
    exit value was non-zero: 1
    id: invalid user name: ""
    PL/SQL procedure successfully completed.
    SQL> execute RunExecCmd('/usr/bin/which id');
    OS Command is: /usr/bin/which id
    /usr/bin/id
    PL/SQL procedure successfully completed.
    Regards,
    Bernard

Maybe you are looking for

  • Fire fox is not opening no matter how many times i click on it

    i am using fire fox 30.0 it is not opening not matter how many times i click, it won't show any action i request please solve my problem i have been working on my pc to become perfect and now when it is this is the only problem i am facing now i can'

  • Material type for Vendors Returnable packaging material

    Dear all, I have a scenario where in i am recieving co2 gas from my vendor against a PO. He is supplying it with cylinders i want to keep track of the cylinders and afetr using the gas want to return the cylinder to vendor. Now the doubt arises, unde

  • Recon Acct and Vendor Acct not tele.

    Hi Experts My report in FBL3N and FBL1N not same. In FBL3N I only key in the;          G/L Code          : 1234                     Company Code : MY01        Open Item date :  30.06.2009        In FBL1N I key in the; Recon account in dynamic selecti

  • ABAP loop inside eCATT

    Hello Colleagues, I want to read multiple values from a table and display for which i going thru an loop . But to display it is becoming an problem can you kindly see the code below . Am trying to store the table fields in an table as mentioend below

  • Integration Server already defined ?

    After delete the  business system for XI 3.0 system on SLD, I wan't to create a new one Business system base on  XI 3.0 TS,but The SLD hint : --Integration Server already defined, There is already an integration server defined for the selected techni