kamabotti khan

Greenhorn
+ Follow
since Jul 13, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by kamabotti khan

Hi

I am trying to open a new xhtml page through the submenu option in icefaces

here is my code sinppet



here when i click on the "Edit a Clause" submenu ,submenu.xhtml opens up but I dont see the body content displayed in the page

my submenu.xhtml contains



when the icefaces submenu opens the submenu.xhtml page I see a blank page instead of the content,and also when I view the source in the browser ,by view source option I still see the icefaces tag displayed ,instead that converting to html.

Anyone please let me know what I am doing wrong
11 years ago
JSF
Hi

I want to reterive a attribute name unique member whose value is only numeric

I am using LDAP search filter to reterive it



In the above code I get the all groups whose name is xyz which has an attribute uniqueMember but I want only those groups which has uniqueMember attribute whose value is only numeric

For ex in ldap structure I have like this


Attribute Name Value
1.uniqueMember uid=18761,ou=people,o=xxx,c=US
2.uniqueMember uid=gsa,ou=people,o=xxx,c=us


So i want to get only Number 2 in my value whose value uid=is number but not uid=gsa which start with letters ,

I added a filter like this but didnot work

11 years ago
The problem was with the path,I gave the path of the files located on the server and it worked ,I don't get any IOException ,but now it is not getting executed (no results) ,so to check the syntax of the string is being passed correctly,I wanted to print p variable but it gives me output
java.lang.UNIXProcess@e5c71af instead of the string



I get an output like P:::java.lang.UNIXProcess@e5c71af instead of this

P:::/local/tmp/postemsg -f /local/tmp/postemsg/test.conf source=Event severity=MINOR appname='HAI' autoticket=YES prisev=P2 hostname=xyz This is for auditing origin=xyz.

So how can I print p var so that I can see how the whole string is being passed


11 years ago
I tried to execute the following using the command line

It displayed the usage of running the command ,so it was able to find the file, But I am deploying my war on the dev server which is hosted on a unix box ,and launching the app or running the app there will that be a problem of not locating the file
11 years ago
I apologize about the colors ,but the file exsists at the location and also has read write permissions.

but when I specify the no :3 method it was looking for the file on the server location where I deployed the war .I even placed the file there
11 years ago
I tried to give the absolute path in different ways

No 1:


This Gives the error

Error: java.io.IOException: Cannot run program "./C:/Desktop/workspaces/default/MyProject/WebContent/WEB-INF/postemsg": java.io.IOException: error=2, No such file or directory



No 2: I even tried with windows executable


This Gives the error

Error: java.io.IOException: Cannot run program "C:/Desktop/workspaces/default/MyProject/WebContent/WEB-INF/postemsg.exe": java.io.IOException: error=2, No such file or directory


No 3 :


This gives the error as

Error: java.io.IOException: Cannot run program "./java.io.FileInputStream@14654146": java.io.IOException: error=2, No such file or directory

Please Help me on this ,what am I doing wrong
11 years ago
Hi this part of the code I tried this



I placed the postemsg executable and test.conf in the WEB_INF folder and which also gets placed in WEB-INF/classes folder after the build ,(using an ANT Script)

Now I get an IO exception ./postemsg file not found. and also one more thing if it is not able to find the postemsg file then it should say "postemsg" file not found,but why it is adding the ./ the unix command used to run files before it
11 years ago
hi,

The requirement is I have to call an executable file postemsg which is an IBM product this should be called from my java file after a one condition is fulfilled.

I have two versions of it a windows executable file and a linux executable file since my code is deployed on server which is hosted on unix box ,I have to use the linux one.

postemsg

Posts an event to the event server using non-Tivoli communication.

Syntax

postemsg -S server | -f configuration_file [-m message] [-r severity] [attribute=value...] class source

Description

The postemsg command sends an event to an event server. This command does not require the use of Tivoli Management Framework services and works in environments where Tivoli software is not installed.

Notes:
Although this command is still supported, the postzmsg command is preferred for sending events using non-Tivoli communication.
If the Tivoli Management Framework is installed on your system, you can use the wpostzmsg (managed node version) or wpostzmsg (endpoint version) command.
Because cache files cannot be shared by applications, you should not use a configuration file for this command that is being used by another program (such as an adapter).
Because this command does not have access to the message catalogs for the language support packs, postemsg displays error messages in English only.

Authorization

None

Options

attribute=value
Assigns a value to any valid attribute. The attribute should be one defined for the event class. Separate multiple attribute=value expressions with spaces.
class
Specifies the class of the event. It must match a class that is configured at the server. Classes are defined by the adapter and listed in the adapter BAROC file. If any blank spaces are in the class name, enclose the class name in double quotation marks.
source
Specifies the source of the event. If any blank spaces are in the source name, enclose the source name in double quotation marks.
-f configuration_file
Specifies the name of the adapter configuration file. You must specify either the -S argument or the -f argument. See the IBM Tivoli Enterprise Console Event Integration Facility Reference for more information about configuration files.
-m message
Specifies the text of the event, enclosed in double quotation marks.
-r severity
Specifies a severity. The severity must be one defined for the event class.
-S server
Specifies the host name or the IP address of the server. Use this option only if portmapper is running on the event server. You must specify either the -S argument or the -f argument.
Examples

The following example for UNIX environments sends a test message that displays an Su_Failure event on the event consoles:

postemsg -S tecbox -r WARNING -m "su login failure." Su_Failure LOGFILE

Now this file is on a tmp directory on server location .
11 years ago
Hi I have a executable file mesg on /tmp location on one our dev server which is hosted on a unix box which again takes a test.conf as a parameter ,It creates a ticket and close it.

So I manually run it logging into the server like this

./mesg -f /tmp/autoticket.conf source=Event severity=MINOR appname='Hai' autoticket=YES appcomponent=`/usr/bin/perl -e"print time();"` prisev=P2 hostname=xyz='GET'' msg=' This is for auditing' origin=XYZ

Now I have to automate this process using java I have to call this executable and pass the parameters.


I have two options I can run the file which is located in host or I can make that conf file and executable file as part of my build and make it run on the dev server when i deploy my code.


I did this I copied the mesg executable file and also test.conf in webinf /classes folder and then I executed this command in my file ticket.java in xyz package

Process p = Runtime.getRuntime().exec("./mesg -f test.conf source=Event severity=MINOR appname='HAI' autoticket=YES appcomponent="+DateFormat.getInstance().format(new Date())+ " "+"prisev=P2 "+ " " + "hostname= " +POSTEMESG_URL+ " " + " This is for auditing origin=" XYZ");

But I get an IOException error ./mesg file not found exception. Please suggest why it is not finding the file

So am doing it right Should I use the other option of not making it part of build and just runing it from the /tmp location of server.


11 years ago
and what is the way to code to login to server and run it
11 years ago
Hi I have an executable placed on unix sever in /tmp folder how can I call that executable within my java program and pass the parameters to it.


11 years ago
I am executing the command already on a linux box like this

.\msg -f /tmp/test1.conf and pass required parameters.

but now this command should be exceuted automatically from java after having one of the condition fulfiled in my application.
12 years ago
Hi

I have a binary file(a file similar to exe file on windows) named msg placed on one of our server which is hosted on unix .The msg is placed in one of the directories in the server location.

I run that msg file ,(which opens a ticket and closes automatically) on unix using a command like this

.\msg and it options and one of the option is a config file that is also placed in the same directory, so now run it something like this

command------------ .\msg -f /tmp/test1.conf and pass required parameters.
So now I have to run this msg (executable file) from java and pass those parameters while running the file, some thing like

if(cond=true)
{
.\msg -f /tmp/test1.conf and pass required parameters
}

how to do that in java ,how can i call that file and excetue that file.Please let me know on how to do this

Thankyou
12 years ago

hi

I am trying to stop from unlocking an account for a domain if the user has made attempts more than 5 times within 24hrs.I have added the check for five times taking the count from the table where failure or success log is stored but I want an additional condition that is ,if the five attempts is within period of 24hrs .I am using ORACLE DB.

The SQL query I am using is

select count(*) from test where acct_name='1234' and domain_name='d' and log_time<= SYSDATE-1.

This gives me the count the user has tried to unlock an account name "1234" on domain name "d" .If this count is more than 5 then I display a error message to user,but know I have to check if the count is more than 5 with 24hrs then display a error message or else the user can unlock.

For example the user named "K" has tried his fifth attempt to unlock today at 10:00 AM ,so until tommorrow 10:00 AM he will be displayed that message,And after tommorrow 10:00 am ,he can start unlocking.

Here is my java implementation for that ,But checking for overall five times,not within 24hrs ,should add that,please help me on this


final String CHECK_UNLOCK_ATTEMPTS = "SELECT count(*) FROM test WHERE acct_name = '"
+ accntname
+ "' AND domain_name = '"
+ domainName
+ "' "
+ "and log_time <= SYSDATE - 1";

// check if the session user has reached more than 5 attempts of unlock
SqlRowSet rs_check_unlock_attempts = jt.queryForRowSet(CHECK_UNLOCK_ATTEMPTS);
int unlock_attempts = 0;

while (rs_check_unlock_attempts.next())
{
unlock_attempts = rs_check_unlock_attempts.getInt(1);
}

if (unlock_attempts > 5)
model.put("errorStr", "You have reached Maxium Attempts of unlock");

}

Please help me on how to do this.


Thanks