Dave Edds

Greenhorn
+ Follow
since Oct 14, 2004
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 Dave Edds

Hi,

I am new to XSLT and have a question regarding some unexpected output. Basically when I pass in some XML which doesn't have the tag referenced in the "template match", I get the contents of the XML ouputted. Here is the concrete example:

The following XSL, simply looks for the tag "error" at the root level and then acts on the next tag "type".



If I supply the XML:

I get the message "IT'S AN ERROR!" This is working as expected.

However, if I supply some XML which doesn't have an <error> tag, e.g.

"Type1" is displayed.

I just don't understand why this is. Can anyone shed any light on this? I can get it to work by rewritting the XSL but can someone please explain why the above XSL is doing what it does?

Thanks,
Dave
[ December 01, 2004: Message edited by: Dave Edds ]
Goutam,

Thanks for your reply. When I have the time I will try that out and report back here with my results.

Thanks again,
Dave
16 years ago
Hi,

Unfortunately I still have not found a solution to my problem! I have tried running using Sun's JVM and lots of jar files from IBM, but it still doesn't work.

As far as I understand it (which admittidly is not very well) there appears to be major differences between IBM's JVM and Sun's JVM. So code that I write for the IBM JVM does not necessarily run outside of IBM's JVM!

Now I thought this would be in violation of the Java standards and so IBM's JVM could not be classed as an official Java VM! But there's obviously some subtelty as to why this is not working that I am not aware of.

Again, if anyone can shed any light onto this whole topic, I would be very interested.

Thanks,
Dave
16 years ago
Hi,

I am doing a JNDI lookup in some Java code using WebSphere 5.1. I compile and run my code and everything works ok.

I export the Java code out of Websphere and using Sun's ver 1.3.1 JVM I try to run the code. I get the following error:


Can anyone shed any light as to why this is happening? I have added many IBM jars to my classpath, but still get this error.

For completeness, my InitialContext is setup as the following


Any help is greatly appreciated,
Dave
16 years ago
Hi,

Thanks for your response. I am surprised that a Jar cannot contain another Jar! I supplied a very simple example, but what I would like to do in my project is have a jar which contains other 3rd party jars e.g. mq, jms, j2ee, etc. (Quick note: I am being forced to use JRE 1.3, hence the need for j2ee.jar)

So what I'll probably do is create my jar file, Go.jar, with references to the other jar files (A.jar, j2ee.jar, etc). When it comes to distribution I will have to ship the runnable jar and all its dependant jars and include documentation to the user to run the runnable jar.

Thanks,
Dave
16 years ago
Hi,

I am having some real trouble with the basics of creating a runnable Jar file. I have read a lot of tutorials and information on the web and believe I understand the subject. But when I write my code it just doesn't work. Can someone please explain to me exactly what I am doing wrong. I'm sure it's something really obvious, but I just can't see it!

This is my situation:
I have a class called dave.util.A. I compile this and put it in a jar file called A.jar. I put this jar file in my "lib" directory.

I have a class called dave.Go. This class has a reference to dave.util.A. I compile Go successfully. I want to create a jar file (Go.jar) which contains Go.class and the A.jar file.

I create a Manifest file (in the META-INF directory) the contents of which is:
Main-Class: dave.Go
Class-Path: lib/A.jar

I create my jar file:
jar -cvfm Go.jar META-INF\MANIFEST.MF dave\Go.class lib\A.jar

The jar file is created and I can check the contents of it (jar -tvf) and it looks good.

However when I run the jar file (java -jar Go.jar) I get a NoClassDefFoundError. My Go.jar does not seem to be looking in its own jar file for the A.jar file.

If I run Go.jar from a directory where there is a lib directory with A.jar in it, then Go.class will run succesfully!!! But this is not what I want, since I want to have a single jar (Go) which contains another jar (A).

I know this should be possible, but what am I doing wrong???

Thanks in advance
Dave
16 years ago
Hmmm...

Okay I think I've found a solution myself. I can create a JAR description when I create the Jar and store this description in a WSAD project. Then when I want to create the Jar file again, I click on the description and select "Create Jar"

This seems to work, but I guess my question now becomes, where should I store my Jar Description file? It has to be in WSAD (so I can click on it), but should it be a seperate project just for the build process? For example, suppose I have the following projects:

com.dave.util
com.dave.gui
com.dave.core
com.dave.publisher
etc...

None of my WSAD projects are a good fit for storing the description. Should I just create a new Project (what type of Project???) which only contains the jar description???

Again, any help is greatly appreciated.
Thanks,
Dave
16 years ago
Hi,

I have a system which consists of various projects in WSAD. The projects are all "Java Projects" and they make up a single application. Just to clarify there is no J2EE involved in this.

I want to create a JAR file, to distribute to my users, which is the project. The JAR must contain MOST of the classes from my projects, but not all classes and files. I can create a JAR file with the export option, but then I have to manually specify which files I want to include. Since there are numerous projects, which are quite large, this becomes a timely process.

Is there any alternative to doing this manual select? I want to start doing daily builds and this slow manual process is not at all productive. Surely there must be some way to state that my application consists of files X, Y and Z, but not file FOO. Do I need to create some other thing (a project?) which states which files should be included in the jar? Am I approaching this all wrong?

If anyone can shed any light on this issue, it would really be appreciated.

Thanks,
Dave
16 years ago
Hi,

I am relatively new to XML / XSL and have a question regarding how I can insert some XML into another XML file.

I have an automated daily build process, using ANT, which invokes JUnit to produce a set of results. I then run an XSLT transform over the results to produce an XML file (Summary.XML) of summary information. This process works fine.

I want to create a History XML file of the results for all days. So I would like to add the information from my Summary.XML file to the end of my History.XML file. In this way I can build up a single XML file of all of the results, which I can graph, chart, do whatever with.

But I cannot append the contents of Summary.XML to the end of History.XML since this would create invalid XML. Is there a way in my XSL transfrom to insert the produced XML to the end of an existing XML file?

I'm really not sure what the best approach is to achieve what I want, so any help or advice would be greatly appreciated.

Thanks in advance,
Dave
Thanks!

I followed your suggestion and came up with some XSLT to do this. If anyone else is interested here is the code:



If anyone knows how to do the rounding for the success rate percentage in a more elegant way, then please post it here!

Rgds,
Dave
17 years ago
Hi,

I would like to keep a history of my Junit results, as management would like to keep a record of the progress the development team is making.

I am using ant to do builds and tests of the code. I have succesfully managed to get junit working and then (within ant) I run junitreport over the output to produce HTML frames showing the results.

I would like to be able to store the summary information (total no of Tests, Failures, errors, etc.) to a file (falt file, XML file, whatever!) so that management can then analyse the progress of the team.

Does anyone know how I can achieve this?

Thanks in advance,
Dave
17 years ago
Hmmm... I simplified my above example to help avoid confusion, but it appears that my simplification has changed the problem!!

Basically I have periods in my project names! Does this make javadoc think that I'm in the source tree? Perhaps I am now asking this in the wrong forum...

Although I am still not getting Javadoc to work and am instead getting an error stating "No public or protected classes found to document." And there are classes to exist in the source!
17 years ago
Hi,

I am trying to Javadoc multiple projects using ant and am not having much luck. I cannot seem to specify that I want to work on multiple projects wihout javadoc complaining that the source files are wrongly named.

I have the following structure on CVS:
ProjectA/src/lots of java code...
ProjectB/src/some more java code...
ProjectC/src/more java...

Using ant I check this out into a directory called "All" and can build it all OK.

However when I attempt to javadoc the projects I can't get it to work properly. Javadoc complains that the source files cannot be found and this is due to the fact that the names of the projects are confusing the Javadoc compiler.

This is the relevant part of my build.xml:



However if I change the packageset from the above to the fileset structure below, I can succesfully generate Javadoc for the individual projects, but then the package structure is not created (which is what I need!)



Can anyone help?

Regards,
Dave
17 years ago