Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Ricky James

Ranch Hand
+ Follow
since Mar 26, 2007
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 Ricky James

Originally posted by Mark Spritzler:
Yes, you will not get it to work because of the different JBoss versions. If the book uses JBoss AS 3, then in order to get their sample to work you need JBoss AS 3. In JBoss AS 4 files like

%JBOSS_DIST%\client\jcert.jar; %JBOSS_DIST%\client\jmx-connector-client-factory.jar; %JBOSS_DIST%\client\jmx-ejb-connector-client.jar;

Are not in the client directory. Those jars do not exist in JBoss 4.0.

So you can either use the EJB tutuorials from JBoss that work with JBoss 4.0, or look at your bat file and remove all the jars that are no longer in the client directory of JBoss.

Mark




Thanks a lot for the explanation Mark. Really appreciate.

I'll try to change the content of the bat file and see if it works.

Thanks again.
Ricky
13 years ago

Originally posted by Sheethal Reddy:
What app server are you running?



Hello Sheethal,

Well, according to this book J2EE RI is a server, although a simple one. But I might have misread it or misinterpreted it so please advise me.

Thanks
Ricky
13 years ago

Originally posted by Vyas:
This means you have not included all the files necessary for the project to run. It seems you have not included Struts library files. Please collect all necessary files or use Netbeans to work on the example



Thanks for the reply Vyas. I'll try to use NetBeans.

Ricky
13 years ago
Hello,

I am using Sun Application Server 9 on my machine. I also have JaveEE and I was trying to deploy one of the sample ejb examples as described in the JavaEE Tutorial. In the tutorial, ant is used to build and deploy the project. When I typed ant it built and gave me all the necessary files but when I tried to deploy it using ant deploy, it gave me this error:

C:\Documents and Settings\HP_Administrator\Desktop\javaeetutorial5\examples\ejb\
converter>ant deploy
Buildfile: build.xml

check:

BUILD FAILED
C:\Documents and Settings\HP_Administrator\Desktop\javaeetutorial5\examples\bp-p
roject\app-server-ant.xml:417: Property javaee.server.passwordfile not specified.
Please specify the javaee.server.passwordfile property in 'bp-project/build.properties'.
You will also need to ensure that the passwordfile is present and contains AS_ADMIN_PASSWORD.

Total time: 0 seconds
C:\Documents and Settings\HP_Administrator\Desktop\javaeetutorial5\examples\ejb\
converter>



I don't really understand what this error means. Can someone please help me with this.

Thanks
Ricky
13 years ago
Hello,

I am trying to set up J2EE 1.3 RI on one of my machines for running sample applications from the book Head First EJB.

But when I try to run this server I get the following error:

C:\Documents and Settings\Administrator\Desktop\HFEcode\HFEJBCODE\advice>j2ee -v
erbose
ERROR: Set J2EE_HOME to the path of a valid j2sdkee.

I have already set the path of J2EE_HOME to C:\j2sdkee1.3.1

I do not understand why it isn't working and would be really thankful if somebody could help me with this.

Thanks
Ricky
13 years ago
Hello,

I am new to EJB and am trying EJB for dummies. I tried to deploy a sample application that can be downloaded from the book website - HelloWorld.

I followed the instructions and everything went well till I reached the section where I have to run this bat file. I get errors when I run it.

By the way, Dummies uses JBoss 3.0.0 while I am using JBoss-4.2.0.GA so I believe there is a problem with the path. Two things I noticed. Firstly, in the bat file the author has used %JBOSS% - Should I change it to something else. Secondly, I notice the files listed in the bat file are different from the ones I have in the client directory of my JBoss installation. So do they all need to be listed or changed.

I have pasted both the bat file and the error I get below. Would be really thankful if someone kindly guides me how I can solve this isssue.

Thanks in advance.
Ricky



java -classpath %JBOSS_DIST%\client;
%JBOSS_DIST%\client\auth.conf;
%JBOSS_DIST%\client\concurrent.jar;
%JBOSS_DIST%\client\gnu-regexp.jar;
%JBOSS_DIST%\client\jaas.jar;
%JBOSS_DIST%\client\jboss-client.jar;
%JBOSS_DIST%\client\jboss-common-client.jar;
%JBOSS_DIST%\client\jboss-j2ee.jar;
%JBOSS_DIST%\client\jbossmq-client.jar;
%JBOSS_DIST%\client\jbosssx-client.jar;
%JBOSS_DIST%\client\jboss-system-client.jar;
%JBOSS_DIST%\client\jcert.jar;%JBOSS_DIST%\client\jmx-connector-client-factory.jar; %JBOSS_DIST%\client\jmx-ejb-connector-client.jar; %JBOSS_DIST%\client\jmx-rmi-connector-client.jar;
%JBOSS_DIST%\client\jnet.jar;
%JBOSS_DIST%\client\jpn-client.jar;
%JBOSS_DIST%\client\jsse.jar;
%JBOSS_DIST%\client\log4j.jar;
%JBOSS_DIST%\client\jndi.properties;%JBOSS_DIST%\server\default\deploy\helloWorld.jar;
%JBOSS_DIST%\lib\mail.jar com.sextanttech.hello.interfaces.Client



C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>helloWorld.bat

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>java -classpath \client;
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)

where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument

-splash:<imagepath>
show splash screen with specified image

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\auth.conf;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\concurrent.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\gnu-regexp.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jaas.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jboss-client.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jboss-common-client.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jboss-j2ee.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jbossmq-client.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jbosssx-client.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jboss-system-client.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jcert.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jmx-connector-client-factory.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jmx-ejb-connector-client.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jmx-rmi-connector-client.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jnet.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jpn-client.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jsse.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\log4j.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\client\jndi.properties;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\server\default\deploy\helloWorld.jar;
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>\lib\mail.jar com.sextanttech.hello.interfaces.Cl
ient
The system cannot find the path specified.

C:\Documents and Settings\HP_Administrator\Desktop\SAMPLE code from EJB 4 DUMMIE
S\HelloWorldProject\clientCode>
13 years ago

Originally posted by Merrill Higginson:
The error message is telling you that you haven't included the UserDTO class in your compile-time classpath when you're trying to compile the LoginBean class.

I'd suggest you not compile classes into the same directory as the source, but specify a different destination directory. Either way, you must include the destination directory in your classpath. example:



Hello Merrill,

Thanks for the reply and advice. I tried what you suggested but I got a lot of errors. The whole of the errors are pasted below. I think I might have to add something to the classpath. Can you please advise what I can do?

Thanks in advance.
Ricky

C:\Program Files\Apache Group\Tomcat 5.5\webapps\Login5b>javac -d WEB-INF/classe
s -classpath /WEB-INF/classes source/dummies/struts/*.java
source/dummies/struts/LoginAction.java:3: package javax.servlet.http does not ex
ist
import javax.servlet.http.HttpServletRequest;
^
source/dummies/struts/LoginAction.java:4: package javax.servlet.http does not ex
ist
import javax.servlet.http.HttpServletResponse;
^
source/dummies/struts/LoginAction.java:6: package org.apache.struts.action does
not exist
import org.apache.struts.action.Action;
^
source/dummies/struts/LoginAction.java:7: package org.apache.struts.action does
not exist
import org.apache.struts.action.ActionError;
^
source/dummies/struts/LoginAction.java:8: package org.apache.struts.action does
not exist
import org.apache.struts.action.ActionErrors;
^
source/dummies/struts/LoginAction.java:9: package org.apache.struts.action does
not exist
import org.apache.struts.action.ActionForm;
^
source/dummies/struts/LoginAction.java:10: package org.apache.struts.action does
not exist
import org.apache.struts.action.ActionForward;
^
source/dummies/struts/LoginAction.java:11: package org.apache.struts.action does
not exist
import org.apache.struts.action.ActionMapping;
^
source/dummies/struts/LoginAction.java:13: cannot find symbol
symbol: class Action
public class LoginAction extends Action
^
source/dummies/struts/LoginAction.java:15: cannot find symbol
symbol : class ActionMapping
location: class dummies.struts.LoginAction
public ActionForward execute( ActionMapping mapping,
^
source/dummies/struts/LoginAction.java:16: cannot find symbol
symbol : class ActionForm
location: class dummies.struts.LoginAction
ActionForm form,
^
source/dummies/struts/LoginAction.java:17: cannot find symbol
symbol : class HttpServletRequest
location: class dummies.struts.LoginAction
HttpServletRequest req
uest,
^
source/dummies/struts/LoginAction.java:18: cannot find symbol
symbol : class HttpServletResponse
location: class dummies.struts.LoginAction
HttpServletResponse response) throws Exception

^
source/dummies/struts/LoginAction.java:15: cannot find symbol
symbol : class ActionForward
location: class dummies.struts.LoginAction
public ActionForward execute( ActionMapping mapping,
^
source/dummies/struts/LoginForm.java:3: package javax.servlet.http does not exis
t
import javax.servlet.http.HttpServletRequest;
^
source/dummies/struts/LoginForm.java:5: package org.apache.struts.action does no
t exist
import org.apache.struts.action.ActionError;
^
source/dummies/struts/LoginForm.java:6: package org.apache.struts.action does no
t exist
import org.apache.struts.action.ActionErrors;
^
source/dummies/struts/LoginForm.java:7: package org.apache.struts.action does no
t exist
import org.apache.struts.action.ActionForm;
^
source/dummies/struts/LoginForm.java:8: package org.apache.struts.action does no
t exist
import org.apache.struts.action.ActionMapping;
^
source/dummies/struts/LoginForm.java:10: cannot find symbol
symbol: class ActionForm
public class LoginForm extends ActionForm
^
source/dummies/struts/LoginForm.java:15: cannot find symbol
symbol : class ActionMapping
location: class dummies.struts.LoginForm
public void reset(ActionMapping mapping, HttpServletRequest request)
^
source/dummies/struts/LoginForm.java:15: cannot find symbol
symbol : class HttpServletRequest
location: class dummies.struts.LoginForm
public void reset(ActionMapping mapping, HttpServletRequest request)
^
source/dummies/struts/LoginForm.java:21: cannot find symbol
symbol : class ActionMapping
location: class dummies.struts.LoginForm
public ActionErrors validate(ActionMapping mapping, HttpServletRequest reque
st)
^
source/dummies/struts/LoginForm.java:21: cannot find symbol
symbol : class HttpServletRequest
location: class dummies.struts.LoginForm
public ActionErrors validate(ActionMapping mapping, HttpServletRequest reque
st)
^
source/dummies/struts/LoginForm.java:21: cannot find symbol
symbol : class ActionErrors
location: class dummies.struts.LoginForm
public ActionErrors validate(ActionMapping mapping, HttpServletRequest reque
st)
^
source/dummies/struts/LoginAction.java:32: cannot find symbol
symbol : class ActionErrors
location: class dummies.struts.LoginAction
ActionErrors errors = new ActionErrors();
^
source/dummies/struts/LoginAction.java:32: cannot find symbol
symbol : class ActionErrors
location: class dummies.struts.LoginAction
ActionErrors errors = new ActionErrors();
^
source/dummies/struts/LoginAction.java:33: cannot find symbol
symbol : class ActionError
location: class dummies.struts.LoginAction
ActionError error = new ActionError("error.login.invalid");
^
source/dummies/struts/LoginAction.java:33: cannot find symbol
symbol : class ActionError
location: class dummies.struts.LoginAction
ActionError error = new ActionError("error.login.invalid");
^
source/dummies/struts/LoginForm.java:23: cannot find symbol
symbol : class ActionErrors
location: class dummies.struts.LoginForm
ActionErrors errors = new ActionErrors();
^
source/dummies/struts/LoginForm.java:23: cannot find symbol
symbol : class ActionErrors
location: class dummies.struts.LoginForm
ActionErrors errors = new ActionErrors();
^
source/dummies/struts/LoginForm.java:26: cannot find symbol
symbol : class ActionError
location: class dummies.struts.LoginForm
errors.add("userName", new ActionError("error.username.required"));
^
source/dummies/struts/LoginForm.java:28: cannot find symbol
symbol : class ActionError
location: class dummies.struts.LoginForm
errors.add("password", new ActionError("error.password.required"));
^
Note: source/dummies/struts/LoginBean.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
33 errors

C:\Program Files\Apache Group\Tomcat 5.5\webapps\Login5b>

13 years ago
Hello,

I am trying to deploy an application from Struts for Dummies. The app has some classes including LoginBean class and a UserDTO class. I am facing problems with these 2. UserDTO compiles ok but when I try to compile LoginBean I get this error:


C:\Documents and Settings\HP_Administrator>cd C:\Program Files\Apache Group\Tomc
at 5.5\webapps\Login5b\source\dummies\struts

C:\Program Files\Apache Group\Tomcat 5.5\webapps\Login5b\source\dummies\struts>j
avac LoginBean.java
LoginBean.java:91: cannot find symbol
symbol : class UserDTO
location: class dummies.struts.LoginBean
UserDTO user = new UserDTO(username, password, age, status);
^
LoginBean.java:91: cannot find symbol
symbol : class UserDTO
location: class dummies.struts.LoginBean
UserDTO user = new UserDTO(username, password, age, status);
^
2 errors


Can someone figure what the problem is. Shall really appreciate.

Thanks in advance.
Ricky James

The code of the 2 files is pasted below:



13 years ago
Hello,

I am writing a simple JSP page in which the user enters the color that she wants for background and on submission the color is displayed in the background. I want to modify the code so that if the user hits submit without entering anything, then the color should be blue.

My attempt is below. Can somebody please advise where I am wrong as at the moment if I leave the field blank then it displays white background.

Thanks
Ricky

13 years ago
JSP

Originally posted by Mirko Bonasorte:
Hi,
You may try to get the background parameter from the request and, if not null, set it into the application scope.Instead, if it's null, you read it from the application scope.



Hello Mirko,

Thanks for the tip. I'll try that.

Cheers
Ricky
13 years ago
JSP
Hello,

I am working on this exercise (pasted below) from the book More Servlets and JSPs by Marty Hall. Would be really thankful if somebody could advise how I should approach this exercise.


"Make a JSP page that lets the user supply a request parameter indicating the background color. If no parameter is supplied, the most recently used background color (from a previous request by ANY user) should be used."


I have attempted this exercise but don't really know how to approach the second part.

Thanks in advance.
Ricky


[ May 30, 2007: Message edited by: Ricky James ]
13 years ago
JSP

Originally posted by Satou kurinosuke:
This is a new method in Mustang (Java 1.6). Are you using jdk 1.6 ?



That explains it. I am using Java 5.

Thanks for the reply and advice Satou.

Much appreciated.
Ricky
13 years ago

Originally posted by Kel Michaels:
You must have a return value. Because all of your returns are wrapped in if blocks you do not have a guaranteed return.

Refactor your code to return a value at the end of the method. So in your if blocks you set the string you want to return to some variable.



Thanks a lot Kel.

That resolved the issue.

Really appreciated.
Ricky
13 years ago

Originally posted by Kel Michaels:
I believe that java.io.Console is new as of Java 6.



Thanks for the reply Kel.

Even I thought that this must be the case but wasn't sure.

Ricky
13 years ago
Hi,

I have written a simple method that returns the name passed and an int variable that counts the no. of visits.

When I try to compile this it give me an error saying that a "return statement is required".

Would be thankful if somebody advised me how I may resolve this issue.



Thanks
Ricky
13 years ago