kritika ram

Greenhorn
+ Follow
since Aug 25, 2006
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 kritika ram

Hi,

We are trying to gather cache statistics of all the applications using ehcache and want to display the information using a JSP, any pointers to cache metrics and monitoring tools will be appreciated.

Thanks in advace,
kitty
13 years ago
Hi,

As part of performance testing, we are looking for a tool or simpler a JSP page to monitor all the caches in the JVM. We would also like to know some cache metrics for the cache, the ones we could think of are :
-Number of cache entries present (in memory and in disk)
-Free and available memory for each cache
-Number of cache hits
-Invalidations (number of invalidations with out getting hit at least for x times)

Please help. Thanks in advance.

Kitty
13 years ago
Thanks for your reply, could you give me some idea or some links for configuring mbeans, I have not worked much with them.
Well, if it is not caching, then is it the watchdog thread problem ? According to log4j documentation:
http://logging.apache.org/log4j/docs/faq.html#2.2

3.6 Is there a way to get log4j to automatically reload a configuration file if it changes?

Yes. Both the DOMConfigurator and the PropertyConfigurator support automatic reloading through the configureAndWatch method. See the API documentation for more details.

Because the configureAndWatch launches a separate wathdog thread, and because there is no way to stop this thread in log4j 1.2, the configureAndWatch method is unsafe for use in J2EE envrironments where applications are recycled.
Hi,

I am using the configureAndWatch() method of DOMConfigurator to enable the periodic check of my application's log4j.xml file. It works fine in a 'stand-alone' mode, but when i deploy my web-app in weblogic, i need to restart my application every time i make some changes to log4j.xml.
Is weblogic caching the log4j.xml somewhere ?

Thanks in advance,
Kitty
Hi,

I would be really thankful if somebody could decipher the below statements for me. I have started to work on web services using Axis and Ant scripts, and was successful with a small example. I need to integrate the example with the Spring framework and with the requirement below. Any help is appreciated.

Requirement :
A developer can register a test stub for a certain Web Service.

Based on the service request the test stub can evaluate the type of test case and an identifier for the request.

Based on the type and the identifier for the test case, the test stub can ask the runtime environment for a test response.

The runtime environment returns a predefined response from a configuration file.

A test stub may replace wild cards and returns the response.

Thanks in advance,
Krithika
13 years ago
@Stu : thanks.. I found a good code coverage tool called 'Clover'that runs on sample code as well apart from unit tests and it works fine with Tomcat for testing my web application.

I need to test it with bea-weblogic. I hope it works.

Thanks again
Iam using tools like locMetrics but should I use code coverage tools like Corbetura and EclipsePro to find the number of lines inside the jar ?

The code is not a JUnit test case but a sample code using the API. The Sample Code is using struts to display the results on a JSP page. But I fail to understand how to use code coverage tools meant for JUnit tests with sample Code.

Thanks again for the help.
I have a certain API whose jar file will be included in the classpath of my project, my manager wants me to find out the number of executable lines of code in the API that is used by my project. I need a utility that can help me with this.
I looked up locmetrics and locc but iam unable to find any software that can find out the number of executable lines in an API that iam using. All of them print the number of lines in my code.

Any help is appreciated. Thanks in advance.
I have to write sample code for Ehcache which loads values into the cache from the database automatically if it is not present in cache.

I have a model which calls the DAO. The DAO has the implementation of creating the cache based on the ehcache.xml configuration. I fail to see the connection between the DAO and the CacheEntryFactory which has a method createEntry() which is supposed to load the cache with the values. Is EhCache supposed to call creatEntry() internally ? If so, it is not calling and nothing gets printed on the console.

Iam attaching the codes here. Sorry if it is too long. Thanks for all the help.

CacheModel.java

public class CacheModel
{
public static void testCache() throws Exception
{

VistaCacheDAO sampledao = new VistaCacheDAO();
VistaCacheVO VO = sampledao.fetchContent(1);
String name = VO.getName();
int age = VO.getAge();
System.out.println ("Name :");
System.out.println (name);
System.out.println ("Age :");
System.out.println (age);
}
}

CacheFactory.java

public class CacheFactory implements CacheEntryFactory
{

public CacheFactory()
{

}

public Object createEntry(Object key) throws Exception
{
CacheEntryKey Key = (CacheEntryKey) key;
int new_ID = Key.getID();
System.out.println(new_ID);
CacheVO VO = new CacheVO();
String query = null;
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(
"jdbc:mysql://xxxxxxxx:xxxx/xxxxxx", "root", "root");
Statement st = con.createStatement();
ResultSet rs = null;
query = "select Name, Age from testcache where ID="+ new_ID;
rs = st.executeQuery(query);

while(rs.next())
{
VO.setAge(rs.getInt("Age"));
VO.setName(rs.getString("Name"));
}

return VO;
}
}

CacheDAO.java

public class CacheDAO
{

public CacheVO fetchContent(int ID) throws Exception
{
CacheVO VO = null;
CacheEntryKey key = new CacheEntryKey();
key.setID(ID);
CacheManager samplemanager = CacheManager
.getInstance("D:/ehcache.xml");
Cache cache = samplemanager
.getCache("sampleCache1");
Serializable value = cache.get(key);
VO = (VistaCacheVO) value;
return VO;
}
}

CacheEntryKey.java

public class CacheEntryKey implements Serializable
{
private int ID;

public int getID()
{
return ID;
}

public void setID(int id)
{
ID = id;
}
}

CacheVO.java

public class CacheVO implements Serializable
{
private int Age;

private String Name;

public String getName()
{
return Name;
}

public void setName(String name)
{
Name = name;
}

public int getAge()
{
return Age;
}

public void setAge(int age)
{
Age = age;
}

}
14 years ago
I know its an old and tried question but i do not understand why this code does not work.

public class testreplace {
public static void main(String args[]){
String key="$re$";
String value = "rec";
String message = "me $re$ now";
message = message.replaceAll(key,value);
System.out.println(newm);
}
}
Iam reading the key and value from a HashMap and i need to replace any occurance of a key with the value in the String.
Please help me out. Thanks in advance.
14 years ago
Hi,
Please help me out with the basics of API building,implementation etc. in java... Iam quite confused where to begin ..I have basic knowledge of java.
Would prefer some pointers on where to look into next.

Thanks a lot