khurram kureshi

Greenhorn
+ Follow
since Dec 28, 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 khurram kureshi

hi,
i've a simple applet that uses threads and it is not working. i'm using netbeans IDE 4.0 with tomcat. when i run the applet i get the follwoing exception in the appletviewer:

java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)

at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at sun.applet.AppletSecurity.checkAccess(AppletSecurity.java:138)
at java.lang.Thread.checkAccess(Thread.java:1218)
at java.lang.Thread.setPriority(Thread.java:964)
at java.lang.Thread.init(Thread.java:334)
at java.lang.Thread.<init>(Thread.java:371)
at org.me.hello.MyApplet.start(MyApplet.java:35)
at sun.applet.AppletPanel.run(AppletPanel.java:413)
at java.lang.Thread.run(Thread.java:595)


this is the applet:

import java.applet.*;
import java.lang.*;

public class MyApplet extends Applet implements Runnable{

/** Initialization method that will be called after the applet is loaded
* into the browser.
*/

int x_pos = 10;
int y_pos = 100;
int radius = 20;

RuntimePermission perm;



public void init() { }

public void start() {
// define a new thread
Thread th = new Thread(this);
// start this thread
th.start();
}

public void stop() { }

public void destroy() { }

public void run() {// lower ThreadPriority
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);

// run a long while (true) this means in our case "always"
while (true) {
// repaint the applet

x_pos++;

repaint();

/*try {
// Stop thread for 20 milliseconds
//Thread.sleep(20);


} catch (InterruptedException ex) {
// do nothing

}*/

// set ThreadPriority to maximum value
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);

}
}

public void paint(Graphics g) { // set color
g.setColor(Color.red);

// paint a filled colored circle
g.fillOval(x_pos - radius, y_pos - radius, 2 * radius, 2 * radius);
}
}

can somebody guide me as to what should i do? i've tried adding:
permission java.lang.RuntimePermission "modifyThreadGroup";

to my java.policy file, the catalina.policy file and still its not working. any help will be helpful thnx.
18 years ago
thnx the application has started to run since i made the change but i still am stuck at something:

<jsp:useBean id="auctionviewbean" class="com.cst.auction.beans.ViewHelperBean"/>

<logic:iterate id="gender" name="auctionviewbean" property="genders" type="com.cst.auction.dataobjects.Gender" >

<html ption value="<%= SQLUtil.checkNull(gender.getGender()) %>"><%= SQLUtil.checkNull(gender.getGender()) %></html ption >

<html ption value="<%= gender.getGender() %>"><%= gender.getGender() %></html ption >

</logic:iterate>

the application stops at the above mentioned logice:iterate tag,
i have all the files and supposedly thr paths r correct too since i am trying to run this application only i dont have access to the beans and the class files as in i dont have access to the code but i can seee the directory structure and everything seems to be in place.....the error lof file has no entries! so what could be wrong with the logic iterate tag in this code? thnx for ure help and hope to hear from u soon.
18 years ago
hi,
well i'm trying to deploy a project that uses struts. when i run the application it stops at the following code in the jsp:

<logic:iterate id="gender" name="auctionviewbean" property="genders" type="com.cst.auction.dataobjects.Gender">
<html ption value="<%= SQLUtil.checkNull(gender.getGender()) %>"><%= SQLUtil.checkNull(gender.getGender()) %></html ption >
<html ption value="<%= gender.getGender() %>"><%= gender.getGender() %></html ption >
</logic:iterate>

the msg in the log file is:

2005-12-29 16:14:29 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
javax.servlet.jsp.JspException: Exception thrown by getter for property genders of bean auctionviewbean
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:860)
at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:300)
at org.apache.jsp.WEB_002dINF.user.home_jsp._jspService(home_jsp.java:671)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1033)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:269)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:436)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:312)
at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)

i dont have access to the bean auctionviewbean. can anybody tell me wot the problem is?

this is the form-bean in the struts-config.xml

<form-bean
name="quickSearchForm"
type="org.apache.struts.validator.DynaValidatorForm">

<form-property
name="watchGender"
type="java.lang.String"
initial="Men"/>
</form-bean>

and this is the action mapping:

<action
path="/quicksearch"
name="quickSearchForm"
scope="request"
validate="false" forward="/WEB-INF/user/home.jsp" />

any help will be appreciated! thnx.
18 years ago
hi,
i'm new to struts and have been facing a problem for quite some time now have gone through almost every listing regarding this problem on this forum and others and still my problem isnt solved.

HTTP Status 404 - Servlet action is not available this is the proble

"type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available."

following is the entry in my web.xml:

<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>

<init-param>
<param-name>mapping</param-name>
<param-value>org.apache.struts.action.RequestActionMapping</param-value>
</init-param>

<init-param>
<param-name>config/admin</param-name>
<param-value>/WEB-INF/admin/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>


<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern> <!-- *.do /do/*-->
</servlet-mapping>

the following is the entry in the struts-config.xml:

<data-sources>
<data-source type="org.apache.tomcat.dbcp.BasicDataSource">
<set-property
property="driverClassName"
value="com.mysql.jdbc.Driver" />
<set-property
property="url"
value="jdbc:mysql://localhost:3306/refinery" />
<set-property
property="username"
value="root" />
<set-property
property="password"
value="root" />
<set-property
property="maxActive"
value="10" />
<set-property
property="maxWait"
value="5000" />
<set-property
property="defaultAutoCommit"
value="false" />
<set-property
property="defaultReadOnly"
value="false" />
<set-property
property="key"
value="refineryDS" />
</data-source>
</data-sources>

when i comment the datasources entry in the struts-config.xml the application starts but if i enable the datasources entry above i get the mentioned error!

<global-forwards>
<forward name="welcome" path="/welcome.do"/>
<forward name="home" path="/welcome.do"/>
</global-forwards>

<action-mappings>
<action
path="/welcome"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/user/home.jsp"/>
</action-mappings>

so plz help me out becoz i cant seem to tackle this error! remember if i comment out the datasources entry the app starts but i need it because i have to connect to the db to make a option list. thnx for ure time....... and yes the entry in the log file is like this:

2005-12-28 20:01:20 StandardWrapperValve[action]: Servlet action is currently unavailable


thats abt it sorry for the long post but i've tried everything and i want u guys to look at it and teme wots wrong. thnx in advance!

p.s- follwoing r the files:

In Re-finery\Sources\Site\WEB-INF\ the following files r present:
struts-bean.tld, struts-html.tld, struts-logic.tld, struts-nested.tld, struts-template.tld, struts-tiles.tld, copy of struts config.xml, struts-config.xml, tiles-defs.xml, validation.xml, validator-rules.xml, web.xml

In Re-finery\Sources\Site\WEB-INF\lib\ the following files r present:
commons-beanutils.jar, commons-collections.jar, commons-dbcp.jar, commons-digester.jar, commons-fileupload.jar, commons-lang.jar, commons-logging.jar, commons-logging-api.jar, commons-pool.jar, commons-resources.jar, commons-validator.jar, mysql-connector-java-3.0.8-s...jar,struts.jar, quartz.jar

and ive made sure that all other files r in thr respective folders, i've made another app that doesnt use struts to check that it connects to the db and it does! so.......?

p.p.s- i have the following code too in my web.xml:

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/refineryDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

???

[ December 28, 2005: Message edited by: khurram kureshi ]

[ December 28, 2005: Message edited by: khurram kureshi ]

[ December 28, 2005: Message edited by: khurram kureshi ]
[ December 28, 2005: Message edited by: khurram kureshi ]
18 years ago