Dirk Lombard

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

Recent posts by Dirk Lombard

You have jmxri.jar and jmxtools.jar in your class path. Somehow Websphere does not like these jars as it uses jmx internally and has a file it wants to use. I can not figure out how to get past the problem and still use jmx. To get your server working again rename the two jars mentioned above and start the server and then remove them from the classpath.
17 years ago
I hope this help someone else

Head First Setup Document

The code in the book does not work with SDK 1.5 so you have to download SDK1.4
Software to download
Download the J2EE RI (Reference Implementation) 1.3
http://java.sun.com/j2ee/sdk_1.3/

Go to the DOWNLOAD button for Java 2 SDK, Enterprise Edition 1.3.1:

Install the above in c:\ j2sdkee1.3.1

Download J2EE SDK 1.4.2_15
http://java.sun.com/products/archive/

Install the above in j2sdk1.4.2_15

Set environmental variables
PATH=%J2EE_HOME%\bin;%JAVA_HOME%\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
JAVA_HOME=c:\j2sdk1.4.2_15
J2EE_HOME=c:\j2sdkee1.3.1

Reboot your PC.
Compiling and running Running Advice Client

I got most of this from Java ranch and can�t improve on it so I will use it.

(This I am adding for those that wonder just like me)
The Windows alternative for the Unix command on page 57 in HFEJB is:
javac -classpath %CLASSPATH%;AdviceAppClient.jar;. AdviceClient.java

But the above might still not work for you!!


One that might work for you:
javac -classpath %J2EE_PATH%\lib\j2ee.jar;AdviceAppClient.jar;. AdviceClient.java



Another alternative:

https://coderanch.com/t/162202/java-EJB-SCBCD/certification/Trouble-running-Advice-EJB

The section below I found in a post by Dewang Lakhani
I would like to repeat the formulae to run AdviceCient :-

INCLUDE ";." AFTER YOUR CLASSPATH i.e
To Compile use :-
"C:\Dewang\j2EEStuff\projects\advice>javac -classpath C:\j2sdkee1.3.1\lib\j2ee.jar;C:\Dewang\j2EEStuff\projects\advice\AdviceAppClient.jar;. AdviceClient.java"


INCLUDE ";." AFTER YOUR CLASSPATH i.e

TO Run use :-
"C:\Dewang\j2EEStuff\projects\advice>java -cp C:\j2sdkee1.3.1\lib\j2ee.jar;C:\Dewang\j2EEStuff\projects\advice\AdviceAppClient.jar;. AdviceClient"


I know it's not necessary to include j2ee.jar explicitly if you have it in your environment varibale. I have it set in my environment but then too i had to explicitly add it.
I am not a C# developer. The point is while the Java community try to sort out what will be the be the "next best" thing the .NET guys are delivering projects.

What will win? Will be JAVAFX, JAVASCRIPT with AJAX, Spring framework or J2EE and JSF, and what to use EJB3, Hibernate, iBatis etc. and then there is the different Portal implementations by different application servers. Is the new web service spec out? You move from one company to the next and your experience is cut in halve. I loved Java and studied hard to learn a lot of different frameworks and certifications but the company I work for has decided to move over to SAP and C#. All the hard effort means nothing now. It is just start from scratch. The C# .NET guys actually become experts and just build on a familiar framework.
Then you should quickly forget it all and learn C# and .NET because Java can not deliver. Every day a new framework is created that has some strong points and some weak point. Business does not care about technical issues they want you to deliver applications to get a strategic edge on their competitors.

The later you can not do if you have to learn a new framework each month. You will have a great general knowledge but you can not be an expert.
Hi

I would like to find out where to look for the application jar file that is being used in a WAS application. We have an EAR, WAR and then just deploy a jar file each time we make changes. The problem is we have two jar files, (created on different dates), in the same folder and need to find out what jar file is being picked up? Where do you look for this mapping? I have looked in the class path, and the deployment descriptor and there is no indication of what file is being use.

Thanks for any reply in advance
17 years ago
Thanks for the reply. That cleared things up for me. I thought I was loosing it there for a moment.
18 years ago
Hi

I am working on code a contractor wrote and saw the following:

static Class _mthclass$(String x0)
{
return Class.forName(x0);
ClassNotFoundException x1;
x1;
throw (new NoClassDefFoundError()).initCause(x1);
}

I would thinks that it should look like this:

static Class _mthclass$(String x0)
{
try
{
return Class.forName(x0);
}
catch(ClassNotFoundException x1)
{
throw new NoClassDefFoundError(x1.getMessage());
}
}

Is the first set of code A way to handle exceptions in Java 5 or is it just something that I have been missing all this time?
18 years ago
What version of log4j are you using? Do you use a PropertyConfigurator.configure("your properties file) to get your set your properties?
Can anybody try and explain to me what happens to the class path variables that you define in WASD or RAD once you move you application to the application server.

What a I did is right click on the application project in the workspace go to properties and click on the Java Build Path and than on the Libraries tab. Then click on Add Variable -> Configure Variable -> New and a variable name and the path to the library or the jar that you want to include. eg. Create a LOG4_J variable that points to you log4j.jar.

You can now use classes inside the jar inside your applications that you develop. My question is what happens if you jar up your application and deploy it to an application server. How does your Websphere Application Server map the LOG4_J variable to the log4j.jar on the application server?

The path is not the same that it was on you PC how will it find the jar?
18 years ago
I have a pre-built war file that I wish to install into RAD 6.0 light-weight
WAS 5.1 test server using the admin console.

Attempting to install the application into a
clean, running Websphere Test Environment v5.1 Server using the admin console throws the following exceptions:

Exception 1
ConfigurationWarning: Failed to open C:\workspace\.metadata\.plugins\com.ibm.wtp.server.core\configs\06_03_07_9_27_AM2-data\cells\localhost\applications\e3_war.ear\deployments\e3_war

Exception 2
DeploymentDescriptorLoadException: META-INF/application.xml

Exception 3
com.ibm.etools.archive.exception.ArchiveRuntimeException: Invalid binaries path: C:\workspace/localhost/e3_war.ear

Exception 3 seems to be the cause of all the problems but where do you define the binary paths so that this will work? I saw a lot of people on the web had this problem but there is no solution for it. It looks like just another error in Websphere Test Environment server that can not be fixed.

Where do you log a error like this for IBM to ignore?

What I know this far about the error the EAR file is not correctly unpacked when you install it. Look your application has been installed under the <your workspace>\.metadata\.plugins\com.ibm.wtp.server.core\configs\06_03_07_9_27_AM2-data\cells\localhost\applications<you installed ear> and you will see the EAR was not extracted correctly there is no class files!!

On the admin console under Enterprise Applications the Application Binaries value on the first page is also wrong.

I do not know how to fix this. Does Anybody have any idea or know of a fix pack that will resolve this issue?

Thanks for any help in advance.
18 years ago
As I understand it you use the mime-mapping to set the contentType when you send a file to the browser. Say for instance you have a file that was created with a *.gif extention you send in either the file name or the .extention and the mime-type that was defined in your web.xml is returned as the content type that is returned to the browser. So for a certain extension you will always return the right content type. So then you browser will know how to render the data it has received.

// set the content type of the image data to be sent to the browser
response.setContentType(getServletConfig().getServletContext().getMimeType(file.toString()));
or response.setContentType(getServletConfig().getServletContext().getMimeType(".gif"));
You use URL rewriting when the client has disabled cookies on the browser. URL rewriting takes the session ID that is in the cookie and stick it right onto the end of every URL that comes in to the application. The Container will strip of this extra part of the request URL and use it to find the matching session when a user request something from a link. All of this is necessary because HTTP is stateless so you cannot keep track of a users session unless you use cookies or URL rewriting.

Why it cannot be used in static pages (html) is for the same reason you can not use scripting and EL in static pages. HTML is not turned into some sort of JAVA class that will be executed. With a JSP the scripting or EL code is turned into JAVA code when the JSP is transformed into a servlet class that will be executed and the response send to the browser. You need a response.endcodeURL or <c:URL> to encode the URL for you and it will only work in a dynamic page.
Hi I passed the SCWCD exam today only 86%. I was a bit dissapointed as I made a mistake of changing stuff that was right to the wrong answer just before my final submit.

My thoughts on preparing for the exam:
1. The HFSJ book is great and a must read and it was the only book I used. There is some errata so check these out when you buy the book.
I do not agree with the answers to all the mock questions but the questions are good or even of a higher standard than the exam.
2. I used the Enthuware mock exams and they are great. You can find them at http://www.enthuware.com/. There is also some errors on these exams but the discussion form normally sort this out. You also learn a lot of interesting stuff doing the questions that is not in the book but very usefull in your working environment.
3.I only skimmed the servlet and JSP spec on specific topics that I was not clear on.
Well that is my thoughts and good luck to all of you that must still write the exam. Don't go change thing once you have finished the exam and before you submit!!!
[ September 21, 2006: Message edited by: Dirk Lombard ]
18 years ago
Hi Kaaima I agree with what you said. But in the question it is not mentioned that there is no matching <uri> element. In JSP 2.0 the container will load the tld files automatically if they are in the right directory according to the specification and I assumed that to be the case.
Page 474 of the HFSJ says there you do not have to specify a <uri> but this is considered bad practice not to do it.In that case the <uri> in the taglib declaration will be used by the container as a path to the actual TLD.

I did read through all the previous post about question 54 problem before I posted my message but I did not find a satisfactory answer. The question in the book does not say that the <uri> was not specified and I still feel the answer in the book is wrong.