Ameya Thakur

Ranch Hand
+ Follow
since Feb 04, 2004
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 Ameya Thakur

Hello All,

I have started with a small project with JSF / Hibernate which I have tested on my local enviroment and it works fine locally when deployed on the server it is throwing the following exception for the 1st time and If I login again and try to save I get the NoClassDefFoundError

1st Error
java.lang.NullPointerException - Unable to instantiate default tuplizer [org.hibernate.tuple.entity.DynamicMapEntityTuplizer

2nd Error
Caused by:
java.lang.NoClassDefFoundError - Exception while invoking expression #{IOPPRegBean.authenticate}

I have ftp all the classes from local to the server and JSF naviagtion is working fine.. I get this error when from my handler class I try to get the Instance of HibernateUtil for saving the value.... we are been struggling like any thing from last 3 days to get it working on the server.....

Our site is hosted on and it is not a decdicated server....

Snippet from HibernatUtil l

Code ffrom the Handler which call HibernateUtil

Also the problem is only on the server... and everything is same even the database is same....

Any thoughts suggestion , details would be welcomed......

Thanks & Regards,
Hello All,

I am very new to Generics and try to get hold of it.. I am having a small assignent for Adding two methods boolean remove(E obj): and Iterator<E> iterator( ):
in the class given below...

boolean remove(E obj): Remove a piece of data from the binary search tree. Return true if the data was removed, or false if it was not in the tree to begin with. Follow the algorithm involving removing items from binary search trees.

Iterator<E> iterator( ): Return an Iterator that can iterate through the data in the tree. The iteration should be an "in-order" iteration (i.e., ascending order). Recall that iterators have the following methods:
boolean hasNext( )
T next( )
void remove( )

It does additional to the list correctly.

I just want it to return Iterator<E> ... since It looked for the implementation for these methods and found that the implementation of these method is given by in

abstract class AbstractList<E>

12 years ago
thanks for the updates .. I would write a servlet and check it ... apart from that do you see any issues in the code or it is just the container which is setting the output back to html.... is there any way where in we can enforce this behaviour through servlet as I have already set the content type in the JSP

I just looked in the genertated class and here it is .... it sets the content type back to html

Is there any other way in which we can achieve this is JSP ?
Hi I am trying a Simple Ajax Example of Populating a DropDown depending upon the value selected.... It looks pretty Starighforward.. I did most of the changes since last couple of day ....but still not able to identify the problem yet....

This is my JS Code


Any Help would be appreciated I am clueless that why I am not getting the XML request Back the code looks ok to me ... even the content type is set to text/xml
On executing following target TESTSQL I am getting following error

The <sql> task doesn't support the nested "path" element.

Is there any way in which i can execute a bunch of SQL together, I am able to execute the SQL individually , but not with the fileset.

<target name="TESTSQL" description="install the sql on dev TestThird">

<sql driver=""
userid="TESTSQL" password="TESTSQL"
<fileset dir="./">
<include name="*.sql"/>

Thanks in Advance
14 years ago
Hello Everyone,

I want the alert message which i give using javascript to be bold

I tried with using alert("<b>Hello</b>");

which is not working so is ther any ways in which we could make "Hello" bold

Thanks a lot in advance
Hi !!!
I am wrting a small store Proc for inserting an value and fetching the Id for the value inserted.

i.e I have Id as an identity column (auto incremented) so i wanted to know the ID for which i am doing the insert operation.

My Store Proc goes like this

CREATE PROCEDURE dbo.spInsertStackTrace
@StackTraceLog as varchar (4000),
@StackTest as varchar (50),
@StackTraceId as int output
Insert Into StackTrace(StackTraceLog,StackTest)
Select @StackTraceId = MAX(StackTraceId) from StackTrace



Persistor myPersistor = PersistorFactory.createPersistor("ccmaster");
CallableStatement cstmt = null;
cstmt = myPersistor.prepareCall("{call spInsertStackTrace(?,?,?)}");
int stackTraceId = cstmt.getInt(3);
System.err.println("Stack Trace Id"+stackTraceId);

with the above code i am getting the following error..

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).

It looks pretty simple i am just not able to figure how to register the out would some one help me and update me that would be very very great.

Thanks a lot

Originally posted by Henry Wong:

Do you mean something like the client's IP address, or hostname? Because, generally, the client that calls a webservice, doesn't have a URL.


The WebService is expecting the following params

String test = obj.getUrl(serviceID,sourceID,clientID,contractID,sourcePID,getCurrentURL(),userHostName,userHostAddress);

I have all other information except for the CurrentURL()

I hope i cleared your doubt.

15 years ago

Originally posted by Ulf Dittmer:
What is the "currentURL" of a Web service?

The webservice expects the CurrentURL as a from where the Service has been invoked.

15 years ago
The Webservice expects an Current URL as a from where the request was made to the webservice...I hope i cleared your doubt

15 years ago
I want to call a webservice for which i require the currentURL,how do we get the currentURL

I was trying Package.

Thanks in Advance,
15 years ago
Hi Carol!!

Ya I wanted to move from this forum to Other Open Source Projects, I gues this can be only done by the moderator.

Anyways I had tried using

package com.cs.test;
import org.apache.log4j.Category;
import org.apache.log4j.Logger;

import com.cs.core.BaseObject;

* @author athakur
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
public class TestLog4jProperties extends BaseObject {
public TestLog4jProperties() {
// TODO Auto-generated constructor stub
private static Logger theClassLogger;
public static void main(String[] args) throws Exception{
//theClassLogger = Logger.getLogger(TestLog4jProperties.class);
//theClassLogger.debug("Hey This is Test I am in Log4JEventLogger ============================>222222222");
try {

TestLog4jProperties obj = new TestLog4jProperties();
catch (Exception e) {
// TODO: handle exception

void a(){
log( LOG_LEVEL_DEBUG, 1, "DEBUG ",this );
log( LOG_LEVEL_ERROR, 2, "DEBUG " ,this);
log( LOG_LEVEL_WARNING ,4, "WARNING " ,this);
log( LOG_LEVEL_TRACE ,5000, "TRACE" ,this);
log( LOG_LEVEL_DETAIL ,5000, "DETAIL ",this );
log(LOG_LEVEL_DEBUG, 5000, "DEBUG",this );
try {
String a ="Ameya";
int b=0;
int c=5/b;
System.err.println("Erro is "+c);
catch (Exception e) {
log(LOG_LEVEL_DEBUG, 5000, "DEBUG",e );
log(LOG_LEVEL_DEBUG, 5000, "This is Event Text","This is Event Details", this,e);
log(LOG_LEVEL_DEBUG, 5000, "This is Event Text","This is Event Details",e);
log(LOG_LEVEL_DEBUG, 5000, "This is Event Text","This is Event Details", this);
//log( LOG_LEVEL_TRACE, 500, "Trace Mode" );
//log( LOG_LEVEL_CRITICAL, 500, "Critical" );

My goes as follow

log4j.rootCategory=DEBUG, R, O
# Control the maximum log file
# Archive log files (one backup file here)
log4j.appender.R.layout.ConversionPattern=[%d{ISO8601}]%5p%6.6r[%t]%x - %C.%M(%F:%L) - %m%n
log4j.appender.O.layout.ConversionPattern=[%d{ISO8601}]%5p%6.6r[%t]%x - %C.%M(%F:%L) - %m%n

My Log4Logger class

public void logEvent(int aEventLogLevel,int aEventCategory,int aEventId,String aEventText,
String aEventDetails,Object aAssociatedObject,Object aObjectInstance,Throwable aThrowable){
String logName;
if (aObjectInstance == null) {
logName = "BaseObject";
else {
logName = aObjectInstance.getClass().toString();//.getName();
System.err.println("Log Name "+logName);
theClassLogger = Logger.getLogger(logName);

switch (aEventLogLevel) {
case 0 :
log( LOG_LEVEL_DEBUG, aEventCategory, aEventText);
case 3 :
theClassLogger.debug("This is a Test"+aEventText);
case 4 :
theClassLogger.debug("Fatal "+aEventText);
case 5 :
theClassLogger.trace("Hey I am In Trace and My Log Level is"+LOG_LEVEL_TRACE+ "-"+aEventText);
case 6 :"aEventText "+aEventText);
case 7 :"aEventText "+aEventText);
case 8 :
case 9 :
theClassLogger.fatal("Fatal "+aEventText);
case 10 :
theClassLogger.fatal("Fatal "+aEventText);
case 11 :
default :
theClassLogger.debug("This is a Been Defaulted Test"+aEventText + "-" +aEventLogLevel);
Hi Carol!!!

private static Logger theClassLogger;

public void logEvent(int aEventLogLevel,int aEventCategory,int aEventId,String aEventText,String aEventDetails,Object aAssociatedObject,Object aObjectInstance,Throwable aThrowable){

String logName;
if (aObjectInstance == null) {
logName = "BaseObject";
else {
logName = aObjectInstance.getClass().getName();
theClassLogger = Logger.getLogger(logName+".class");
switch (aEventLogLevel) {
case 0 :
theClassLogger.debug(LOG_LEVEL_DEBUG, aEventCategory, aEventText);
case 3 :
theClassLogger.trace(LOG_LEVEL_TRACE,aEventCategory, aEventText);
default :
theClassLogger.debug(LOG_LEVEL_DEBUG, aEventCategory, aEventText);

Since we are having our Own Logging mechanism and we wish to move to LOG4J with minimal changes this is the approach which i thought would be right.

But when i try to implement this at the runtime I get an Error stating
log4j:WARN No appenders could be found for logger (com.cs.applications.corconnect.CorConnectServlet.class).
log4j:WARN Please initialize the log4j system properly.

So would you kindly suggest or give me some more inputs on the same

Thanks & have a great weekend Ahead
I am not putting log4j.debug=true, I would just try debug=true and then check it out.

I have removed the invalid appenders and then sent it acorss to you....

Currently i am not facing an issue with the file not found exception as I have created a test Project and working on that as i have lot may things to do using log4j... I have done JDBCAppenders which is good.

Also I whave a scenario over here I know log4j provides a feature where-in you can specify different Logging Level for different classes

i.e ClassA is been logged using Debug Mode and ClassB is been logged using Error mode...
Sorry that I am replying a bit late.....It is a problem and I am curious to know about it , ie why is it throwing Class Not Found Exception after reading from a file.....

I wanted to include Invalid appenders just to check whether my is been properly validated and is present in the classpath of the project

For time been My is the simplest you would find



log4j.appender.File.layout.ConversionPattern = %d | %5p | [%t] | %c:%M(%L) | %m %n

The code from where I am trying to acess the code is
1st Approach

2nd Approach
Properties myProp = ResourceUtils.getResourceAsProperties("");

over here my SOP reads from the and prints it..but does not validates it.....

so I was just curious to know about the same

Thanks & Regards,