satya mahapatra

Ranch Hand
+ Follow
since Jan 07, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by satya mahapatra

Thanks a lot Christophe for your help and quick response.
Thanks Christophe for the quick response. Then I can directly start with EJB3.0.
Could you please suggest some good books to start with?

Thanks,
Satya
Hi All,

I am new to EJB. Can I directly start with EJB3.0 or knowledge of EJB2.0 is required?
And kindly suggest some good books.

Thanks,
Satya
Hi Joe,

Table is there in Database as I am using the scott schema. When I tried to access the DB from a standalone java program it is working fine,


Thanks,
Satya
16 years ago
Hi Everyone,

I am trying to connect to DataBase from a sample struts application.But I am getting the below error.

SEVERE: Initializing application data source org.apache.struts.action.DATA_SOURCE
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-00942: table or view does not exist
)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.setLogWriter(BasicDataSource.java:959)
at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:808)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:335)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.sql.SQLException: ORA-00942: table or view does not exist

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:304)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:271)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:622)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:111)
at oracle.jdbc.driver.T4CStatement.execute_for_describe(T4CStatement.java:350)
at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:895)
at oracle.jdbc.driver.T4CStatement.execute_maybe_describe(T4CStatement.java:382)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:985)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1124)
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:332)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1249)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
... 30 more

Struts-config
==========

<data-sources>
<data-source type="org.apache.tomcat.dbcp.dbcp.BasicDataSource">
<set-property property="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<set-property property="url" value="jdbc:oracle:thin:@brahma-d93ed835:1521:orcl" />
<set-property property="username" value="scott" />
<set-property property="password" value="tiger" />
</data-source>
</data-sources>

If anyone has any idea why I am getting this error please let me know.

Thanks,
Satya
16 years ago
Hi,

I have created sample web application using MyEclipse6.5. There is just one welcome page is there. When I am giving the Context path I am expecting the welcome page should be displayed. The entry in the web.xml file is as follows.

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>


The web.xml file is inside \WebRoot\WEB-INF\web.xml. According to this I have modified the context.xml inside Tomcat 6.0\conf as below.

<WatchedResource>/WebRoot/WEB-INF/web.xml</WatchedResource>

But still its not able to pick the web.xml and thats why showing 404 error. Any idea where else I need to change?

But when I removed the WebRoot folder and only kept the WEB-INF folder directly inside the context path then its working fine.

Is there any way to customize the directory structure of the web application and please let me know where i am going wrong.

Thanks,
Satya
16 years ago
Hi,

Thanks a lot for your wishes.
Hi,

Last Saturday I cleared SCWCD with 89%. Just missed 1%. But still I am happy with my score.

First I would like to thank HF authors for writing such a wonderful book. Then I would like to thank javaranch which make me feel that I am not alone preparing the exam. So many other people are also there around world who are also preparing for it and helping each other.

Preparation:

Duration: 2 and half months.

Book: Only HF (Read it 3 times thoroughly)

Exam Simulator: Whizlab

Specs: Those who have cleared the exam before me, suggested that to get a good score specs are must. So I just have a look at them for my satishfaction. But didn�t read it thoroughly. Because specs are very huge and bit boring also.

Code: All the examples of all the chapters of HF.

I got 59% in HF final mock exam. So for me its +30%.

Suggestion for ranchers who are preparing for SCWCD:

Read HF thoroughly. HF is more then enough to clear the exam. And you should code all the examples of book. Simply reading the book won�t help much. So if you really want to have a good understanding of the concept then you must try all the examples from the book.

I bought Whiz lab Simulator and it really helped me.

That�s all from my side. Thanks once again for all your support.
Hi,

In HF page-254 it is written that except HttpSessionBinding Listener all other listeners should be registered in web.xml

But in whizlabs Simulator it is given that both HttpSessionBinding and HttpSessionActivation listeners can't be configured in web.xml.

Please let me know which is correct.

Thanks,
Saty
Congrtas for a fantastic score

Can you please tell me how you have prepared for the Specs. Beacuse the specs are really huge almost 350 pages each. How much time you dedicated for specs.

Thanks,
Satya
Congrats

Also share your way of preparation. That will definetly help lots of ranchers who are preparing for the SCWCD.

Thanks,
Satya
Hi Christophe,

Yah I have copied the standard.jar and jstl.jar in WEB-INF\lib folder.


Thanks,
Satya
Hi Marc,

When I removed errorPage directive scriptlet from errorPage.jsp its working fine. But when I am keeping both means scriptlet errorpage and web.xml entry ,its not working.

Anyway one way it work fine. Thanks for your help.

Thanks,
Satya
Hi All,

I am trying to test the application given in HF to test <error-code> tag. But not able to figure out why this isn't working.

form.html
==========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test Error Page </TITLE>
</HEAD>
<BODY>
<form action="badPage.jsp">
<input type="submit" value="Submit" />
</form>
</BODY>
</HTML>

badPage.jsp
==============
<%@ page errorPage="errorPage.jsp" %>
<html>
<body>
Division result is::
<% int i = 10/5; %>
<%= i %>
<form action="errorPage.jsp">
<input type="submit" value="Submit" />
</form>
</body>
</html>

errorPage.jsp
===============
<%@ page isErrorPage="true" %>
<html>
<body>
Coming Inside ErrorPage.jsp
</body>
</html>

web.xml
=========
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<error-page>
<exception-type>java.lang.ArithmeticException</exception-type>
<location>/errorPage.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/errorPage.jsp</location>
</error-page>
</web-app>

This code is working fine. Control is going from badPage.jsp to errorPage.jsp.But when I am doing 10/0 in badPage.jsp it is showing page cannot be displayed.Its not displaying errorPage.jsp.

Any idea where I am doing the mistake.

Thanks,
Satya