Pally Gharmount

Ranch Hand
+ Follow
since Aug 25, 2004
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 Pally Gharmount

Let me first say what i am using...i am running Jboss 4.0.2 under windows with Apache Tomcat/5.5.9.

I am trying to deploy an JSTL application under tomcat that uses a data datasource defined in oracle-ds.xml.

Here is the steps I took...

1) Edited E:\Java\jboss-4.0.2\server\default\deploy\oracle-ds.xml

<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc racle:thin:@xxx.ad.bgs.ac.uk:1521:xx</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>xxx</user-name>
<password>xxx</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
</local-tx-datasource>

2) Copied the Oracle Database drivers to E:\Java\jboss-4.0.2\server\default\lib\classes12.jar

3) I edited the file E:\Java\jboss-4.0.2\server\default\deploy\jbossweb-tomcat55.sar\server.xml and added the following line...

<Context path="/master" docBase="E:\Java\MasterContext" debug="1"></Context>

I know that works as I can access a basic JSP page with JSTL.

4) So far so good. Everything seems fine with the DataSource as I have deployed a J2EE app that uses it and it works fine...here is a quick snippet from the

<jbosscmp-jdbc>
<defaults>
<datasource>java:/OracleDS</datasource>
<datasource-mapping>Oracle8</datasource-mapping>
<create-table>false</create-table>
<remove-table>false</remove-table>
<read-only>true</read-only>
<pk-constraint>true</pk-constraint>
<preferred-relation-mapping>foreign-key</preferred-relation-mapping>
</defaults>

5) The problem happens when a try accessing a JSP page with the following JSTL code....dont think its the JSTL bit that's causing the problem

<sql:setDataSource var="Source"
driver="oracle.jdbc.driver.OracleDriver"
url="jdbc racle:thin:@xxx.ad.bgs.ac.uk:1521:xxx"
user="xxx" password="xxx" />

<sql:query var="courses" dataSource="${Source}">
SELECT ID, NAME, DESCRIPTION, ICON, SEQ FROM psg.BGS_DEVELOPERS_INDEX ORDER BY SEQ
</sql:query> <this works fine as i have explicitly defied the DataSource>

<sql:query var="courses2" dataSource="java racleDS">
SELECT ID, NAME, DESCRIPTION, ICON, SEQ FROM psg.BGS_DEVELOPERS_INDEX ORDER BY SEQ
</sql:query> <this is trying to use the DataSource defined oracle-ds.xml and doesnt work, see message below>

<c:forEach var="item" items="${courses.rows}">
<c ut value="${item.name}"/>
</c:forEach>


Error Message

javax.servlet.ServletException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.psg.JSTLExample_jsp._jspService(org.apache.jsp.psg.JSTLExample_jsp:103)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
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:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
18 years ago
I'm using Tomcat 5 on windows XP and its complaining that im using Java 1.5...as I have it installed...

if i type...java -version...at the command line i get java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)

ive set the JAVA_HOME & JRE_HOME TO my 1.4 version but it doesnt like it...

but i did read somewhere ages ago that you can point at your java environment in one of the tomcat xml files....is this true...if so how do you do it?
18 years ago
In a nutshell can somebody explain to me what Struts is?

I am working on a J2EE project and have used the JSP/Servlet->Session Manager->Factory->Entity Bean model previously.

Where would i use struts and wha benefits do they have?
18 years ago
Im working at work and have now passed the exam, what are we allowed to put under our email signatures i.e. text and may be an image of duke and sun icon.
is there a date when this will become out of data i.e. if taking the developers exam can u have 1.4 or 5 and how about contents is most of the stuff in 1.4 in 5?
i am very sure the answer is still 2, as there are only 2 StringBuffer objects being created with the new keyword but one reference (s2) points to an existing object (s1).
[ May 06, 2005: Message edited by: Pally Gharmount ]
are these allowed in the exam?

always get confused when u get questions like -2.6+ -9
do you get the exam mark straight away?
Just wondering if the exam tells you how many answers to tick when a question has multiple answers..

Thanks in advance
I have an application running on Apache Tomcat/4.1.30, can any body tell me how many times a certain web page is accessed and how long the session was for and the ip address of the clients machine?

or do i have to write some statements in my web page that logs it to a file or database?

Thanks in advance
19 years ago
just seen this in the k&b book, bit confused with this as i thought you would have to do sn explicit String cast like in the example below.

System.out.println(5+6);
System.out.println(""+(5+6));

Ive had code at work where my program would fail to compile if i didnt do the string cast and was suprised when the example above worked...can any one give me examples where a string cast is required when printing out primitives/objects.
is this the K&B book every one is talking about thats good for revision?

Sun Certified Programmer & Developer for Java 2 Study Guide (Exam 310-035 & 310-027)
Kathy Sierra, Bert Bates

Product Details
Paperback
Published: 01 December, 2002
Publisher: Osborne McGraw-Hill
ISBN: 0072226846
RRP: �36.99
A question..

if storing your objects in a treemap or treeset. do your objects have to implement comparable interface or compartor interface? whats the difference between these?

i have writtten code that imlements comparable and provides implementation of the compareTo(Object obj) method and works fine.
ive a good understanding of the collections framework. do we need to know about all of the methods, i.e. which ones orginate from the collection interface and which ones are in Set and SortedSet.?
Hi, i have been learning interfaces,

i have learnt interfaces have method declarations but no method body which is fine and they are also allowed attributes can be declared...

How ever thinking about it they are just abstract methods, i tried placing the abstract modifier in the method and it still complied..

here is the code

public interface House {
static int doorNumber=1;
public void repair();
public abstract void replaceWindows();
}

can some one please clarify the difference between these or are these the same?