Ashok Sharma

Greenhorn
+ Follow
since Dec 08, 2008
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 Ashok Sharma

Thanks Theodore,
Actually i had given you very simple example but i have one complex cron expression stored in database, based on that i have to calculate the next execution time and store in database so one scheduler process will check if the current time is less than the calculated time then process the transaction.
And there will be different cron expressions for different client subscriptions.
So I was looking at any generic function that can calculate next execution time from the given cron expression.
14 years ago
In my project requirement i wanted to have one function which will calculate next execution time using cron expression.

Here i have one cron expression which says every 25 minutes, i want to have one function which will be passed with cron expression and time and function should return next execution time.

i was wondering if any ready function available for the same.
14 years ago
Yes, i can see the files in WEB-INF directory.
14 years ago
Hi All,
i am using struts validation framework, to achive this i have made following changes.
1. Validation plag-in definition is added in struts-config.xml


2. validation.xml and validator-rules.xml is added in the WEB-INF folder, struts-config.xml is also available in the same folder.
3. Extend forms from ValidatorForm instead of ActionForm

But when i start resin i get following error message.

By looking at the error message it seams system is not able to locate validation XMLs but these XMLs are already available in the path specified. So i am not able to identified the cause of the problem.

Please help.


[17:47:33.187] Loading validation rules file from '/WEB-INF/validator-rules.xml'
[17:47:33.203] Loading validation rules file from '/WEB-INF/validation.xml'
[17:47:33.437] null
[17:47:33.437] java.lang.NullPointerException
[17:47:33.437] at org.apache.commons.validator.ValidatorResources.internalProcessForms(ValidatorResources.java:464)
[17:47:33.437] at org.apache.commons.validator.ValidatorResources.process(ValidatorResources.java:415)
[17:47:33.437] at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:162)
[17:47:33.437] at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
[17:47:33.437] at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
[17:47:33.437] at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
[17:47:33.437] at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
[17:47:33.437] at javax.servlet.GenericServlet.init(GenericServlet.java:70)
[17:47:33.437] at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:776)
[17:47:33.437] at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:707)
[17:47:33.437] at com.caucho.server.dispatch.ServletManager.init(ServletManager.java:150)
[17:47:33.437] at com.caucho.server.webapp.WebApp.start(WebApp.java:1726)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.437] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.437] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.437] at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:671)
[17:47:33.437] at com.caucho.server.host.Host.start(Host.java:437)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.437] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.437] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.437] at com.caucho.server.host.HostContainer.start(HostContainer.java:473)
[17:47:33.437] at com.caucho.server.cluster.Server.start(Server.java:1092)
[17:47:33.437] at com.caucho.server.cluster.Cluster.startServer(Cluster.java:689)
[17:47:33.437] at com.caucho.server.cluster.ClusterServer.startServer(ClusterServer.java:431)
[17:47:33.437] at com.caucho.server.resin.Resin.start(Resin.java:710)
[17:47:33.437] at com.caucho.server.resin.Resin.initMain(Resin.java:1146)
[17:47:33.437] at com.caucho.server.resin.Resin.main(Resin.java:1343)
[17:47:33.437] javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
[17:47:33.437] at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:172)
[17:47:33.437] at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
[17:47:33.437] at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
[17:47:33.437] at javax.servlet.GenericServlet.init(GenericServlet.java:70)
[17:47:33.437] at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:776)
[17:47:33.437] at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:707)
[17:47:33.437] at com.caucho.server.dispatch.ServletManager.init(ServletManager.java:150)
[17:47:33.437] at com.caucho.server.webapp.WebApp.start(WebApp.java:1726)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.437] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.437] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.437] at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:671)
[17:47:33.437] at com.caucho.server.host.Host.start(Host.java:437)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.437] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.437] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.437] at com.caucho.server.host.HostContainer.start(HostContainer.java:473)
[17:47:33.437] at com.caucho.server.cluster.Server.start(Server.java:1092)
[17:47:33.437] at com.caucho.server.cluster.Cluster.startServer(Cluster.java:689)
[17:47:33.437] at com.caucho.server.cluster.ClusterServer.startServer(ClusterServer.java:431)
[17:47:33.437] at com.caucho.server.resin.Resin.start(Resin.java:710)
[17:47:33.437] at com.caucho.server.resin.Resin.initMain(Resin.java:1146)
[17:47:33.437] at com.caucho.server.resin.Resin.main(Resin.java:1343)
[17:47:33.453] javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
[17:47:33.453] at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:172)
[17:47:33.453] at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
[17:47:33.453] at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
[17:47:33.453] at javax.servlet.GenericServlet.init(GenericServlet.java:70)
[17:47:33.453] at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:776)
[17:47:33.453] at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:707)
[17:47:33.453] at com.caucho.server.dispatch.ServletManager.init(ServletManager.java:150)
[17:47:33.453] at com.caucho.server.webapp.WebApp.start(WebApp.java:1726)
[17:47:33.453] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.453] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.453] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.453] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.453] at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:671)
[17:47:33.453] at com.caucho.server.host.Host.start(Host.java:437)
[17:47:33.453] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.453] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.453] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.453] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.453] at com.caucho.server.host.HostContainer.start(HostContainer.java:473)
[17:47:33.453] at com.caucho.server.cluster.Server.start(Server.java:1092)
[17:47:33.453] at com.caucho.server.cluster.Cluster.startServer(Cluster.java:689)
[17:47:33.453] at com.caucho.server.cluster.ClusterServer.startServer(ClusterServer.java:431)
[17:47:33.453] at com.caucho.server.resin.Resin.start(Resin.java:710)
[17:47:33.453] at com.caucho.server.resin.Resin.initMain(Resin.java:1146)
[17:47:33.453] at com.caucho.server.resin.Resin.main(Resin.java:1343)
14 years ago
Hi Sagar,
Thanks for your reply but the points mentioned there are programmatic error, if there would be these type of errors then the application should not work on other's machine also. As i had mentioned in my post that this application is working on my 2 friends machine with same version of resin and java so i guess this is not trivial error.
There must be some ting wrong in my machine's configuration.

Thanks again...
14 years ago
Hi All,
i have one strange problem.
I am trying to run one struts web application which is running on my friends machine on the same version of resin, but that application is giving exception on my machine.
We are using same version of java
JAVA_HOME = C:\Program Files\Java\jdk1.6.0_03

What i had do to run the application is
1. Installed the freas copy of resin3.1.8
2. Copy the application in webapps dir
3. Start resin

when i try to access the application by it gives me below error, but when i use the same steps in my friends machine it works fine. I have tried this n2/3 windows machines it works fine but gives error in my machine. So i am not getting what could go wrong.
In this application html:form tag is used.


javax.servlet.ServletException: javax.servlet.jsp.JspException: Exception
creating bean of class com.forus.common.form.LoginForm: {1}
at com.caucho.jsp.PageContextImpl.handlePageException(PageContextImpl.java:1211)
at _jsp._jsp._common._index__jsp._jspService(_index__jsp.java:111)
at com.caucho.jsp.JavaPage.service(JavaPage.java:61)
at com.caucho.jsp.Page.pageservice(Page.java:578)
at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:195)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.servlet.jsp.JspException: Exception creating bean of class
com.forus.common.form.LoginForm: {1}
at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:487)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)
at _jsp._jsp._common._index__jsp._jspService(/jsp/common/index.jsp:41)
at com.caucho.jsp.JavaPage.service(JavaPage.java:61)
at com.caucho.jsp.Page.pageservice(Page.java:578)
at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:195)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)
at java.lang.Thread.run(Thread.java:619)

Thanks in advance...


14 years ago
Thanks for you reply,
So is memory allocated to MaxPermSize is a part of memory allocated to Xmx?
15 years ago
Hi RaviNada Kiran/Joe Ess,
i am still not clear with the use of these two marameters (heap size and permanent generation space).
Could you put more light on this?

In my appliaction this configuration is getting used
-Xms128m -Xmx1024m -XX:PermSize=64M -XX:MaxPermSize=256M

I am not sure whether we can keep mx greter then MaxPermSize, in my case mx=1024 and MaxPermSize=256?

Thanks in advance.
15 years ago
we are using spring jdbc framework in our project.

Right now we have kept the transcation boundry at the service level which the entry point from client side to sever side.
We have applicationContext.xml file where we have defined the transcation boundry condition for each service.

here is piece of code of applicationContext.xml
<tx:advice id="txAdvice" transaction-manager="txManager">
<!-- the transactional semantics... -->
<tx:attributes>
<!--
all methods starting with 'select' or 'get' are read-only
all methods that start with save require a new transaction
-->
<tx:method name="select*" read-only="true" />
<tx:method name="get*" read-only="true"/>
<tx:method name="save*" propagation="REQUIRES_NEW" />
<tx:method name="insert*" read-only="false" propagation="REQUIRES_NEW" />
<tx:method name="update*" propagation="REQUIRES_NEW" />
<tx:method name="import*" propagation="REQUIRES_NEW" />
<!-- other methods use the default transaction settings (see below) -->
<tx:method name="*"/>
</tx:attributes>
</tx:advice>

<!-- @1. Ensure that the above transactional advice runs for any execution
of an operation defined by the service interfaces.
@2. Defines Transaction Manager Boundaries.
-->
<aop:config>
<aop:pointcut id="usersServiceOperation" expression="execution(* com.smartLMS.server.user.services.UserService.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="usersServiceOperation" />
</aop:config>

But in one case the entry point is one sevlet from where we call the sevice method and and from service we call a method from domain object
In this case the transcation boundry is not getting applied.
and if i want to set the transaction boundry in DO level how can i do this?

Please help.
Sorry! for posting in wrong forum. I will take care of this in future.
I have also changed my display name on forum.
Thanks for your directions
15 years ago
Yes i mean the browser window, and user is using same browser that is mozzila. User opens one browser window and login as normal user then he opens another window of same browser and login as admin user, then in first window his role gets changed as admin user and the user is not logged out from the first window.
I want to log the user out from first window if he login in another window.
15 years ago
Hi All,
I have a problem regarding java session management.
i have created one web application in which i want if user login from one browser instance and opens another instance of same browser and logs in from that then user should be logged out from previous window. I am using Mozzila 5.0.

Here is what i am doing while creating session in LoginServlet.java

session = request.getSession(false); //return session if already exists
System.out.println("Session object: "+session);
if(session != null)
{
System.out.println("Session ID Old: "+session.getId());
session.invalidate(); //invalidate the session if already exists
}
session = request.getSession(true); //Create new session
System.out.println("Session ID New: "+session.getId());

Second and third System.out.println() statements giving the same session id.

This way only the information stored in session when user was logged in from first window is replaced with the new information stored in second window login, but the user is not logged in from the first window though its role is changed suppose in first window he logged in using nornal user login and in second window he logged in as admin user then in first window users role is getting changed to Admin.

Please help me out how i can log the user out from first window if he logs in from second window.

Thanks in advance...
15 years ago