piyush kumar

Greenhorn
+ Follow
since Feb 01, 2007
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 piyush kumar

I have read the collection tutorial , i want some thing related to performance tuning with collection can anybody help me with that.
16 years ago
Hi All,

I want to make my knowledge of Collection Framework better. Can anybody suggest any links for the same which can give me each and every information about the collections, regarding which collections to use , when to use the particular type of collection, the performance issue whicle using the particular type of collection etc.

Thanks in advance.
16 years ago
Hi all,
i have one jsp which is called viewserver.jsp and viewaction class, now what i am doing is ion my jsp there are some radio buttons and corresponding values of the radio button. now when i click on the radio button iot calls a javascript function serverid(this.form, this.value) in which i am passing the form and the corresponding value which is clicked . now i want that this value should be transffered to my Action class which uis viewaction for furthur processing. c an anybody tell me how to transfer the single value to the action class.
thanks in advance
16 years ago
I am creatg a simple struts application while runng it....It is givg the follog expection.......



javax.servlet.ServletException: Exception creating bean of class com.ibm.FirstAForm: {1}
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.Test_jsp._jspService(org.apache.jsp.Test_jsp:87)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

javax.servlet.jsp.JspException: Exception creating bean of class com.ibm.FirstAForm: {1}
org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:487)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)
org.apache.jsp.Test_jsp._jspx_meth_html_form_0(org.apache.jsp.Test_jsp:103)
org.apache.jsp.Test_jsp._jspService(org.apache.jsp.Test_jsp:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.
16 years ago
Hi, Jaikiran

Thanks for the reply i got the help which I needed. Thanks again.
16 years ago
Hi, Tamas

I have done this thing already but I am getting exception thrownthat "No getter method for fname of the bean rsults."
16 years ago
HI all,

can anybody please let me know the configuration of the Jboss server for providing the secrity constraints in the web application. I want to configure Jboss for BASIC as well as Form based Authentication technique.

please help.
thaks in advance
[ September 13, 2007: Message edited by: David O'Meara ]
16 years ago
Yes, My struts-config file is as follows:

<struts-config>

<form-beans>
<form-bean name="userForm" type="we.persistent.UserForm"></form-bean>
</form-beans>

<global-forwards>
<forward
name="user"
path="/user.jsp"/>
</global-forwards>

<action-mappings>
<action
path="/user"
type="we.persistent.UserAction"
parameter="AddUser"
name="userForm"
input="/user.jsp"
scope="session"
validate="true">
</action>
<action
path="/luser"
type="we.persistent.UserAction"
parameter="ListUser"
name="userForm"
scope="session"
validate="false"
input="/user.jsp"/>
<action
path="/suser"
type="we.persistent.UserAction"
parameter="SearchUser"
name="userForm"
scope="session"
validate="true"
input="/user.jsp">
<exception key="error.NoResultsFoundException"
type="we.persistent.NoResultsFoundException"
path="/user.jsp"/>
</action>


</action-mappings>

<message-resources parameter="we.persistent.MessageResources" />

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>

</struts-config>
16 years ago
public class UserAction extends DispatchAction
{

//Performs The SearchUser Action When the user submits the form and clicks the SearchUser button
public ActionForward SearchUser(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception
{
UserSearchService service = new UserSearchService();
ArrayList<String> results = null;

UserForm userForm = (UserForm) form;

String name = userForm.getFname();

if(name != null & name.trim().length()>0)
results = service.search(name);
if(results.size()< 1)
{
System.out.println(results.size());
throw new NoResultsFoundException();
}

userForm.setResults(results);

return new ActionForward("/user.jsp");
}

//Performs The ListUser Action When the user clicks the ListUsers link
public ActionForward ListUser(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res)
{
UserForm userForm = (UserForm) form;
Connection con= null;
Statement stmt = null;
ResultSet rs = null;
ArrayList<String> result = new ArrayList<String>();

try
{
con = ConMgmt.getConnection();
System.out.println("success");
stmt = con.createStatement();
rs = stmt.executeQuery("select * from puser");

while(rs.next())
{
String fname = rs.getString(1);
String lname = rs.getString(2);
result.add(fname);
result.add(lname);
}

userForm.setResults(result);
} catch (SQLException e) {

e.printStackTrace();
}
return new ActionForward("/user.jsp");
}
}
16 years ago
hmm i tried these steps but got the following excption:

javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean results in any scope
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)
org.apache.jsp.user_jsp._jspService(user_jsp.java:172)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
16 years ago
i am getting this excption:


javax.servlet.ServletException: javax.servlet.jsp.JspException: No collection found
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)
org.apache.jsp.user_jsp._jspService(user_jsp.java:214)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
16 years ago
Hi all,

I am little bit conffused regarding the usage of logic:iterate tag.
I am getting an error always No collection found and others.
Let me tell the actual scenario:

I have a jsp in which I am using
<logic:iterate id="rsult" name="userForm" property="results">
<bean:write name="rsult" property="fname"/>
<bean:write name="rsult property="lname"/>
</logic:iterate>

Now i am using a Form Bean by the name of "userForm" which contains an attribute "results" of the type ArrayList and its corresponding getters and setters.

now the action class is calling the model class to perform some database transactions and then the result obtained is added one by one to an arraylist and returned to the action class from where it is set to the Form Bean by the setter method. after this the jsp page while displaying the contents throwing the exceptions.

pleae help regarding this?
[ September 17, 2007: Message edited by: Bear Bibeault ]
16 years ago
HI all,
Can anyone please tell me something about the Garbage Collector. besides that, it is used for freeing up the memory resources. I want to now what all types of objects it collects and how does it maintain the list of these objects to be collected and what algorithms it uses for freeing thememory? (Please help)
thanks in advance
piyush kumar
16 years ago

Originally posted by piyush kumar:
Hi all,

I am getting this stacktrace while conecting my java to oracle. I am using eclipse 3.3, oracle9i and java1.5.

the stacktrace is as follows:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3668)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:353)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:371)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:551)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:351)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:169)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:105)
at web.persistent.ConMgmt.getConnection(ConMgmt.java:21)
at web.persistent.TestConnection.main(TestConnection.java:21)
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]


also while debuging the program it is stucking to a line where i say
ds = new OracleDataSource(); // it is sayig source not found while comming to this line.

SOurce Code:

public class ConMgmt
{
private static OracleDataSource ds;
public static Connection getConnection() throws SQLException
{
if(ds==null)
{
ds=new OracleDataSource();
ds.setUser("scott");
ds.setPassword("tiger");
ds.setURL("jdbc:oracle:thin:@localhost:1521:oradb");
System.out.println(ds.getLoginTimeout());
}
return ds.getConnection();
}



Hello all

My above problem is solved by some cofiguration settings for oracle. I started "lsnrctl.exe" file from oracle home and the problem got resolved as the exe file was on the stopped status in the services. But now a new problem is coming this "lsnrctl.exe" is using port 8080 for some of its listening endpoints so while this is running my application server JBoss cannot run. Can anybody please let me know if i can change the port of JBoss server and How? or else any other solutionto this problem.

Thanks in advance
piyush
Hi all,

I am getting this stacktrace while conecting my java to oracle. I am using eclipse 3.3, oracle9i and java1.5.

the stacktrace is as follows:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3668)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:353)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:371)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:551)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:351)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:169)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:105)
at web.persistent.ConMgmt.getConnection(ConMgmt.java:21)
at web.persistent.TestConnection.main(TestConnection.java:21)
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]


also while debuging the program it is stucking to a line where i say
ds = new OracleDataSource(); // it is sayig source not found while comming to this line.

SOurce Code:

public class ConMgmt
{
private static OracleDataSource ds;
public static Connection getConnection() throws SQLException
{
if(ds==null)
{
ds=new OracleDataSource();
ds.setUser("scott");
ds.setPassword("tiger");
ds.setURL("jdbc:oracle:thin:@localhost:1521:oradb");
System.out.println(ds.getLoginTimeout());
}
return ds.getConnection();
}