Noel Castillo

Greenhorn
+ Follow
since Jan 03, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Noel Castillo

I have added a post showing my .bat files in "Here's why bad command appears...(WIN98)". I recommend for you to try it out on your machine and see if it works. I cannot help much if I don't see your settings and the echoed DOS command line.
~Noel
[This message has been edited by Noel Castillo (edited June 05, 2001).]
In my AUTOEXEC.BAT:


SET CLASSPATH=D:\jdk1.3\jre\lib\rt.jar;D:\j2sdkee1.3\lib\j2ee.jar;
PATH=%PATH%;D:\jdk1.3\bin;D:\j2sdkee1.3\bin
SET J2EE_HOME=D:\j2sdkee1.3
SET JAVA_HOME=D:\jdk1.3


My SETENV.BAT (renamed to SETENV0.BAT):


@echo off
rem
rem Set JAVA_HOME and J2EE_HOME before running this script.
rem
rem first include user-specified definitions.
call %J2EE_HOME%\bin\userconfig.bat
if "%JMS_HOME%" == "" set JMS_HOME=%J2EE_HOME%
set LIBDIR=%J2EE_HOME%\lib
set LOCALEDIR=%J2EE_HOME%\lib\locale
set CLOUDSCAPE_INSTALL=%LIBDIR%\cloudscape
set CLASSESDIR=%LIBDIR%\classes
set JMS_CLASSESDIR=%JMS_HOME%\classes
set J2EEJARS=%LIBDIR%\j2ee.jar
set JAVART=%JAVA_HOME%\jre\lib\rt.jar
set JAVATOOLS=%JAVA_HOME%\lib\tools.jar
set SYSTEMJARS=%JAVART%;%JAVATOOLS%
set JAVAHELPJARS=%LIBDIR%\jhall.jar
rem JMS DB PATH must end in slash to specify a directory
set JMS_DB_PATH=%J2EE_HOME%\repository\%COMPUTERNAME%\db\
set SYSTEM_LIB_DIR=%LIBDIR%\system
set JMS_RI_JDBC=%SYSTEM_LIB_DIR%\cloudscape.jar;%SYSTEM_LIB_DIR%\tools.jar
set CLOUDJARS=%JMS_RI_JDBC%;%CLOUDSCAPE_INSTALL%\RmiJdbc.jar;%CLOUDSCAPE_INSTALL%\client.jar
set CPATH=%CLOUDJARS%;%CLASSESDIR%;%JMS_CLASSESDIR%;%J2EEJARS%;%LOCALEDIR%;%SYSTEMJARS%;.;%JAVAHELPJARS%

rem set JAAS_OPTIONS=-Djava.security.auth.policy=%J2EE_HOME%\lib\security\jaas.policy
rem set SSL_OPTIONS=-Djavax.net.ssl.trustStore=%J2EE_HOME%\lib\security\cacerts.jks
rem set SOCKET_FACTORY=-Dcom.sun.CORBA.connection.ORBSocketFactoryClass=com.sun.enterprise.iiop.IIOPSSLSocketFactory
rem set LISTEN_OPTIONS=-Dcom.sun.CORBA.connection.ORBListenSocket=SSL:0,SSL_MUTUALAUTH:0,PERSISTENT_SSL:1060
rem set JAVACMD=%JAVA_HOME%\bin\java -Xmx128m %SSL_OPTIONS% %JAAS_OPTIONS%


My J2EE.BAT (renamed to J2EE0.BAT):


@echo off
rem
rem Set JAVA_HOME and J2EE_HOME before running this script.
rem
rem set JAVA_HOME to the path where you have Java 2 (JDK1.2) installed.
rem
rem set J2EE_HOME to the path where you have installed this package (EJB server).
rem
if not "%J2EE_HOME%" == "" goto CONT0
echo ERROR: Set J2EE_HOME before running this script.
goto END
:CONT0
if EXIST "%J2EE_HOME%\bin\setenv0.bat" goto CONT1
echo ERROR: Set J2EE_HOME to the path of a valid j2sdkee.
goto END
:CONT1
call %J2EE_HOME%\bin\setenv0.bat
if not "%JAVA_HOME%" == "" goto CONT2
echo ERROR: Set JAVA_HOME before running this script.
goto END
:CONT2
if EXIST "%JAVA_HOME%\bin\java.exe" goto CONT3
echo ERROR: Set JAVA_HOME to the path of a valid jdk.
goto END
:CONT3

rem @echo on
rem %JAVACMD% %LISTEN_OPTIONS%
-Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter
-Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl
-Djms.home=%JMS_HOME%
-Dcom.sun.jms.service.jdbc.dbpath=%JMS_DB_PATH%
-Djms.properties=%J2EE_HOME%\config\jms_service.properties
-Djava.security.policy==%J2EE_HOME%\lib\security\server.policy
-Djava.security.auth.login.config=%J2EE_HOME%\lib\security\login.config
-Dcom.sun.enterprise.home=%J2EE_HOME%
-classpath "%CPATH%" com.sun.enterprise.server.J2EEServer %1 %2
@echo on
java -Xmx128m
-Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter
-Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl
-Djms.home=%JMS_HOME%
-Dcom.sun.jms.service.jdbc.dbpath=%JMS_DB_PATH%
-Djms.properties=%J2EE_HOME%\config\jms_service.properties
-Djava.security.policy==%J2EE_HOME%\lib\security\server.policy
-Djava.security.auth.login.config=%J2EE_HOME%\lib\security\login.config
-Dcom.sun.enterprise.home=%J2EE_HOME%
-classpath "%CPATH%" com.sun.enterprise.server.J2EEServer %1 %2
:END


OUTPUT IN DOS WINDOW:


D:\j2sdkee1.3\bin>j2ee0 -verbose
D:\j2sdkee1.3\bin>java -Xmx128m -Dorg.xml.sax.parser=org.xml.sax.helpers.XMLRead
erAdapter -Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl -Djms.hom
e=D:\j2sdkee1.3 -Dcom.sun.jms.service.jdbc.dbpath=D:\j2sdkee1.3\repository\\db\
-Djms.properties=D:\j2sdkee1.3\config\jms_service.properties -Djava.security.pol
icy==D:\j2sdkee1.3\lib\security\server.policy -Djava.security.auth.login.config=
D:\j2sdkee1.3\lib\security\login.config -Dcom.sun.enterprise.home=D:\j2sdkee1.3
-classpath "D:\j2sdkee1.3\lib\system\cloudscape.jar;D:\j2sdkee1.3\lib\system\too
ls.jar;D:\j2sdkee1.3\lib\cloudscape\RmiJdbc.jar;D:\j2sdkee1.3\lib\cloudscape\cli
ent.jar;D:\j2sdkee1.3\lib\classes;D:\j2sdkee1.3\classes;D:\j2sdkee1.3\lib\j2ee.j
ar;D:\j2sdkee1.3\lib\locale;D:\jdk1.3\jre\lib\rt.jar;D:\jdk1.3\lib\tools.jar;.;D
:\j2sdkee1.3\lib\jhall.jar" com.sun.enterprise.server.J2EEServer -verbose
J2EE server listen port: 1050
Naming service started:1050
Binding DataSource, name = jdbc/Cloudscape, url = jdbc:cloudscape:rmi:Cloudscape
DB;create=true
Binding DataSource, name = jdbc/DB2, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
te=true
Binding DataSource, name = jdbc/DB1, url = jdbc:cloudscape:rmi:CloudscapeDB;crea
te=true
Binding DataSource, name = jdbc/EstoreDB, url = jdbc:cloudscape:rmi:CloudscapeDB
;create=true
Binding DataSource, name = jdbc/InventoryDB, url = jdbc:cloudscape:rmi:Cloudscap
eDB;create=true
Binding DataSource, name = jdbc/XACloudscape, url = jdbc/XACloudscape__xa
Binding DataSource, name = jdbc/XACloudscape__xa, dataSource = COM.cloudscape.co
re.RemoteXaDataSource@649dcd
Starting JMS service ... Initialization complete - waiting for client requests
Binding : < JMS Destination : jms/Topic , javax.jms.Topic >
Binding : < JMS Destination : jms/Queue , javax.jms.Queue >
Binding : < JMS Cnx Factory : QueueConnectionFactory , Queue , No properties >
Binding : < JMS Cnx Factory : TopicConnectionFactory , Topic , No properties >
Binding : < JMS Cnx Factory : jms/TopicConnectionFactory , Topic , No properties<br /> >
Binding : < JMS Cnx Factory : jms/QueueConnectionFactory , Queue , No properties<br /> >
Starting web service at port:8000
Starting secure web service at port:7000
Apache Tomcat/4.0-b1
Starting web service at port:9191
Apache Tomcat/4.0-b1
J2EE server startup complete.


NOTES:

  1. My RAM(64KB) or DOS cannot handle a very long command line so I had to take out the %LISTEN_OPTIONS% values. I don't know what the later effects of that would be.
  2. Pay attention to the variable assignments, I had problems with these while playing around with the SET= settings. Type SET in the DOS prompt to display the variables' values (but you already know that).
  3. Check the echoed JAVA command line to make sure all the expected values are displayed up to "-verbose". If the values are incomplete J2EE will not run.
  4. You may have realized by now the futility of starting J2EE in WIN98 so it might be wise to get ORION SERVER if you are like me who don't want to switch to WIN2000 yet.
  5. I have not deployed any application yet - I've tried the JAVA PET STORE on ORION but got stuck somewhere, posted for help on this site and got 0 reply. Oh now I remember why I switched to J2EE server. If you got something pls. reply to that post.

  6. ~Noel

    [This message has been edited by Noel Castillo (edited June 05, 2001).]
David,
I posted a response for the bad command or file name situation, "Here's why bad command appears...(WIN98)".
I hope this helps.
~Noel

Originally posted by steven minnerly:
Maybe I'm missing something obvious but isn't j2ee 1.3 beta only for windows nt and windows 2000 professional? Will is still run on windows 98 too?
steve


Steve,
With some modifications, J2EE1.3 will run under windows98/95. What SUN is claiming is that Windows98/95 is not a supported OS platform for J2EE1.3, meaning - if you choose these platforms, you are on your own as far as problems/bugs are concerned.
Ray,
I posted a response for the bad command or file name situation, "Here's why bad command appears...(WIN98)".
I hope this helps.
~Noel
when you run J2EE.BAT in win98 even if you have set the correct pathnames (path=%PATH%;d:\j2sdkee1.3\bin) and variable names JAVA_HOME and J2EE_HOME.
J2EE.BAT calls SETENV.BAT w/c causes a syntax error at the set JAAS_OPTIONS=.. line because DOS does not accept 2 '=' signs for the SET command (try SET VAR=VAR1=VAR2 in DOS and you'll see what I mean). On the last statement, set JAVACMD=, nothing is assigned to JAVACMD, so after the call to SETENV.BAT - returning to J2EE.BAT, the %JAVACMD% command cannot be recognized because there's no value set for it. Now, we realize why Win95/98 is not a supported platform for J2EE.
So the best thing is to comment out all the lines with the double '=', eg. set %JAAS_OPTIONS%, and the set JAVACMD= line as well. But first, backup the files you are trying to change because you might make some mistakes and may need to go back to the original file to start all over again.
In the J2EE.BAT, comment out the %JAVACMD% line and substitute the commented out variables in SETENV.BAT, eg. %JAVACMD%, %SSL_OPTIONS%, etc. with the hardcoded values. This is how my %JAVACMD% %LISTEN_OPTIONS -Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter ... line finally looks like:

%JAVA_HOME%\bin\java -Xmx128m
-Djavax.net.ssl.trustStore=%J2EE_HOME%\lib\security\cacerts.jks
-Djava.security.auth.policy=%J2EE_HOME%\lib\security\jaas.policy
-Dcom.sun.CORBA.connection.ORBListenSocket=
SSL:0,SSL_MUTUALAUTH:0,PERSISTENT_SSL:1060
-Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter
-Dorg.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl
-Djms.home=%JMS_HOME%
-Dcom.sun.jms.service.jdbc.dbpath=%JMS_DB_PATH%
-Djms.properties=%J2EE_HOME%\config\jms_service.properties
-Djava.security.policy==%J2EE_HOME%\lib\security\server.policy
-Djava.security.auth.login.config=%J2EE_HOME%\lib\security\login.config
-Dcom.sun.enterprise.home=%J2EE_HOME%
-classpath "%CPATH%" com.sun.enterprise.server.J2EEServer %1 %2


Take note of the spacings because some of them could actually be line feeds. If this happens you will see a break in the command chain, and you will get bad command again. Also, hard tabs can wreak havoc to your syntax in .bat and .config files. I was using an editor that did not display the tab characters and I only discovered them when I opened the file in Notepad.
One last note, the variable %JAVACMD% might be referenced by other .BAT files in the \bin direcotry so you should check to make sure it is substituted properly.
Now, you are ready to face the next set of problems of running J2EE!
~Noel
[This message has been edited by Noel Castillo (edited June 05, 2001).]
I am trying to install Java Pet Store (JPS1.1.1) on Orion 1.4.5 w/ J2SDKEE1.3 and WIN98 following the procedure in this link. I got stuck at this part: install orion-config-jps1.0.zip c:\
Confirm file overwrite: yes to all.

First, I don't have this zip file and I don't know where to get it. It's not even in the orion web site or part of the Orion1.4.5 zip. I realize the instruction is for an older version JPS1.0 but I can't find any other relevant instruction, so...
Can anyone instruct me on how to proceed to the next step, successfuly? cd \orion
java -Djsp.reuse.tags=false -jar orion.jar

I'm new to J2EE, thanks.
~Noel

------------------
Anyone able to successfully start J2EE and run an app on Win98? I'd like to know if it is really possible (I've seen some posts saying yes) as I don't want to install Windows 2K yet.

Originally posted by Manfred Leonhardt:
Noel,
The exam title says it all...
SCJP2
Manfred.


Are you implying that only JDK 1.2 is compliant with Java 2?? What about JDK 1.2.1 +?
[This message has been edited by Noel Castillo (edited April 12, 2001).]
Manfred, thanks for your response. True, JQ+ may have been tested against JDK 1.2 but does the SCJP2 exams (for w/c we are practicing the mocks for) preclude JDK1.3 compliant syntax? If your passing mark depended on the correct answer to this question, should your answer reflect JQ+ or JDK1.3? Remember, in the exams there is only right or wrong answer.
<pre>
Question ID :958011966030
Consider the following lines of code...
System.out.println(null + true); //1
System.out.println(true + null); //2
System.out.println(null + null); //3
Which of the following statements are correct?
JQ+ Correct Answer: 1) None of the three lines will compile.
My Comment:
1) The program compiled successfuly under TextPad 4.4.0 w/ JDK1.3
2) USING KAWA 5.0 + jikes; this is the result (compile-error):

Working Directory -
D:\jdk1.3\jikes\bin\jikes.exe -d "d:\My Java\Class Files" "Java SCJP Work\Test.java"
Working Directory - D:\My Java\
Class Path - d:\My Java\Class Files;.;D:\jdk1.3\jre\lib\rt.jar;d:\myjava~1\javasc~1;D:\Program Files\Kawa5.00\kawaclasses.zip;d:\jdk1.3\lib\tools.jar;d:\jdk1.3\jre\lib\i18n.jar
File Compiled...
--------------------------- Compiler Output ---------------------------
Found 3 semantic errors compiling "D:/My Java/Java SCJP Work/Test.java":
4. System.out.println(null + true);
<-->
*** Error: The type of this expression, "null", is not numeric.
5. System.out.println(true + null);
<-->
*** Error: The type of this expression, "boolean", is not numeric.
6. System.out.println(null + null);
<-->
*** Error: The type of this expression, "null", is not numeric.

3) USING KAWA 5.0 + javac (successful compile and run)
D:\My Java\
Class Path - d:\My Java\Class Files;.;D:\jdk1.3\jre\lib\rt.jar;d:\myjava~1\javasc~1;D:\Program Files\Kawa5.00\kawaclasses.zip;d:\jdk1.3\lib\tools.jar;d:\jdk1.3\jre\lib\i18n.jar
File Compiled...
No Errors...
Working Directory - D:\My Java\Class Files\
Class Path - d:\My Java\Class Files;.;D:\jdk1.3\jre\lib\rt.jar;d:\myjava~1\javasc~1;D:\Program Files\Kawa5.00\kawaclasses.zip;d:\jdk1.3\lib\tools.jar;d:\jdk1.3\jre\lib\i18n.jar
nulltrue
truenull
nullnull
Process Exit...
</pre>

[This message has been edited by Noel Castillo (edited April 11, 2001).]

Originally posted by sandeep vijan:

<PRE>
.....
Float r=new Float(st).floatValue();//"float" is primitive data
//type and "Float" is class
ar=2*3.14*r*r;
System.out.println(ar);
}
}
</PRE>


Your code will not compile because:
a) Float r=new Float(st).floatValue();
the floatValue() method in the anonymous object(type Float) returns a primitive value, float, for which you assigned it to a reference variable, Float r.
b) ar=2*3.14*r*r;
operator * obviously works only for primitive values of w/c Float r is not
c) operator * will not work for 3.14 as the compiler sees an assignment with narrowing conversion from double to float. it needs the f or F suffix (3.14f)
This is how the 2 lines should work:
float r=new Float(st).floatValue();
ar=2*3.14f*r*r;

[This message has been edited by Noel Castillo (edited January 05, 2001).]
23 years ago


Jacquie's 'Tried and True' Method for Learning Java Properly
....
14. From this point forward, your options are open-ended! For example, you may wish to become familiar with Java 2 Enterprise Edition, which provides support for enterprise-level server-side applications; you may wish to study up on the Java 2D and 3D graphics APIs; or your interests may lie with the Java 2 Micro Edition (J2ME), a highly optimized Java runtime environment targeting consumer products such as cellular phones and pagers. Whichever direction you choose to take, you can rest assured that there will be plenty of new Java-related innovations in the months and years to come.


Jacquie,
Thank your for your "Tried" and "True" post. As a Java newbie, it will help me a lot in aligning my efforts towards the true north in Java. My observation from your tips is that you did not mention UML w/c helped me a lot in digesting the concepts presented in the Mughal&Rasmussen book. I would sometimes reverse-engineer some of their examples just to get a high-level view of the concepts.
Also, you did not mention design patterns. I understand these are important when trying to learn OO Design. My goal after SCJP is to understand patterns and implement a small project.
Lastly, I know that the options are wide open after going thru your 13 tips, however you only mentioned JDBC and not the other quite popular new technologies (in my perspective) like JSP, servelets, XML. How do these rank to you as things to aspire for in becoming more marketable in Java?
I wish you success with your book.
All the best,
Noel Castillo

[This message has been edited by Noel Castillo (edited January 04, 2001).]
23 years ago