Kishen Singh Punjabi

Ranch Hand
+ Follow
since Sep 14, 2012
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kishen Singh Punjabi


- This query works fine in sql but in HQL when I use session.createQuery(sqlQuery) , i get error saying unexpected token (

Thanks in Advance!!
Got it resolved by adding

and listener method in Manager
6 years ago

I have a dataTable with checkbox in header and check box in each row , when checkbox in header is selected all the rows will be selected.
When I select one/more rows a button should be enabled which is happening because a listener is invoked when a row is selected / unselected.
When I select the checkbox in header all the rows are getting selected but the listener is not invoked..what am I missing here..

My xhtml :

My Manager Class :

I am using primefaces-3.5 , javax.faces-2.1.14
I cannot upgrade my primefaces..

Thanks in Advance..
6 years ago
I am using log4j.xml in a web application , when I do the following the logs are created but the logs are not written
Stop the application server.
Add war file to deployments folder.
Start the application server.

But , when I do the following the logs are created and also logs are populated as expected.
Start the application server without any war in it.
then add the war file , it gets deployed.

My App Server - Jboss 6.3 EAP.

I am build a maven project which have a an other project as dependency.

pom.xml of Project B contains dependency of Project A. What I am looking for is when I build Project B , the project A should build first and should be moved to repository mentioned in my repositories section and then using that project A artifact from maven repo Project B should be built.

7 years ago

Am able to send logs to syslog but the daily rolling is not happening.How to do it..?
Below is my log4j.xml

<appender name="AsyncEnter" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="RemoteAsyncEnter" />

<appender name="RemoteAsyncEnter" class="">
<param name="syslogHost" value="" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="- %m%n" />

<logger name="Enter" additivity="false">
<level value="info" />
<appender-ref ref="AsyncEnter" />

Greg Charles - Thank You for the suggestion.

I cannot overwrite the log file with the newly added records as the log file is being populated from an external system. But I have the read access to the file and can read the records from it but the problem here is am reading all the records everytime which I do not want.

Richard Tookey - Thank You for the suggestion.

Yes I agree with you, counting the number of lines will not be fast enough since to find the 'n'th line ..
I do not have control over the process of writing the records to the log file.
How do I proceed with the size based approach ?
7 years ago

I want to run a shell script which retrieves only the newly added records from the last time the script is run.

A log file is created at 12:00 pm and new records get added to it every second.

A shell script is made to run every 30 minutes to retrieve the newly added records.
If the script is run at 12:30 pm, it must only the records between 12:00 and 12:30 pm.
If the script is run at 01:00 pm, it must only the records between 12:30 and 01:00 pm.

Note: The log have the date along time but I do not want to trace the records for the date/time.
Can I achieve something like this using the size of the file.

Any suggestions ?

7 years ago
Got it working !!

Added <param name="MaxBackupIndex" value="3"/> to the configuration

value 3 means number of files to be created

Would it be possible to rotate and create log files based on size. Say, if my maximum limit is 2MB .
Once the log file abc.log reaches size of 2MB a new log file with name abc_1.log should be created and abc.log should become empty.
Again when abc.log reached size of 2MB there should be a new file created with name abc_2.log

Is this possible with log4j.xml in any App Server like JBoss ,Tomcat..

I tried this

But abc.log.1 is created and the rest are not created. Infact , abc.log.1 is getting overidden and the previous logs are lost.

Thanks !!
Can anyone suggest any forums(other than Stackoverflow) where I can get help on this..
Any Help Guys..?

Iam using Solr 4.3. My solrconfig.xml

My schema.xml

"Description" is a column in a Database Table -

CopyField -

FieldType -

In DB I have details like

When I query as


Returns me only - movie
I want the solr to return the below as suggestions which is not happening :(

What configuration need to be updated

I have also tried



Is /suggest component faster than the /select ? I can have only the required columns indexed and and return only the required fields data. In such case is /select not same as /suggest ?

Thanks in Advance!!
Thanks Shiva, so what do you suggest for a 3/3.5 year experienced Java guy to go with.

Option 1 : OCPJP 6 then OCPJP 7 ?
Option 2 : OCAJP 7 then OCPJP 7 ?

Sorry my Question is similar to the one below but I seriously need your suggestions on this

Shivi Kashyap wrote:
You can prepare yourself for OCAPJP6 exam instead of OCPJP7 (which requires one more exam to pass to be a java programmer) but with OCPJP, there is no issue.

Sorry, Did not understand this.

For OCPJP 7 certification we have to write two exams OCAJP 7 and OCPJP 7 where as for OCPJP 6 we have only one exam..?