Amit Gupt

Greenhorn
+ Follow
since May 26, 2005
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 Amit Gupt

I was asked this question in one of my job interviews. I dont know the right answer so am putting it out for people to respond.

If you encounter an OutOfMemoryException then how will you be able to narrow the scope of the problem ?

I said use a profiler and see all the usefull stats like how many objects are getting created, how many are getting destroyed etc and figure out the piece of code thats causing the problem. Once you are able to narrow the scope of the problem go through the particular code and look for place where objects are getting instantiated but somehow not getting garbage collected.

To this the interviewer asked if there is a long running suite of test scripts and this error is encountered after 4 hrs since the script started executing then how would you figure out the source of the problem ?

I was not able to give a convincing answer for this question. Can someone share your experiences for this question ?
18 years ago
I think Head First Design Pattern is a really good book to start on Design Patterns.
Am getting this error in Tomcat logs :

servlet.UnavailableException: Parsing error processing resource path /WEB-INF/config/struts-config.xml
at org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:739)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:715)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:670)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:329)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:888)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:776)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3363)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3586)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:774)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:760)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:548)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:260)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:741)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:445)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:353)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:671)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1149)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)


I have been looking at my struts-config.xml for quite some time but cannot find any errors in the xml. My struts-config.xml looks like this :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<!-- ========== Form Bean Definitions ================================== -->
<form-beans>
<form-bean name="courseForm" type="blackboard.plugins.courseregistration.presentation.CourseForm" />
</form-beans>

<!-- ========== Action Mapping Definitions =============================== -->
<action-mappings>
<action
path="/course"
parameter="method"
type="blackboard.plugins.courseregistration.presentation.CourseAction"
name="courseForm"
scope="request"
input=""
validate="false">
<forward name="display" path="course_display.jsp" redirect="false"/>
<forward name="register" path="course_register.jsp" redirect="false"/>
</action>
</action-mappings>
</struts-config>

Can anyone tell me what the error is ? Any help is highly appretiated.
18 years ago
Am getting this error in Tomcat logs :

servlet.UnavailableException: Parsing error processing resource path /WEB-INF/config/struts-config.xml
at org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:739)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:715)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:670)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:329)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:888)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:776)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3363)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3586)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:774)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:760)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:548)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:260)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:741)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:445)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:353)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:671)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1149)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)


I have been looking at my struts-config.xml for quite some time but cannot find any errors in the xml. My struts-config.xml looks like this :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<!-- ========== Form Bean Definitions ================================== -->
<form-beans>
<form-bean name="courseForm" type="blackboard.plugins.courseregistration.presentation.CourseForm" />
</form-beans>

<!-- ========== Action Mapping Definitions =============================== -->
<action-mappings>
<action
path="/course"
parameter="method"
type="blackboard.plugins.courseregistration.presentation.CourseAction"
name="courseForm"
scope="request"
input=""
validate="false">
<forward name="display" path="course_display.jsp" redirect="false"/>
<forward name="register" path="course_register.jsp" redirect="false"/>
</action>
</action-mappings>
</struts-config>

Can anyone tell me what the error is ? Any help is highly appretiated.
18 years ago