Randall Stevens

Ranch Hand
+ Follow
since Jul 01, 2003
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Randall Stevens

Is there anyone out there with an answer? Placing the files in the lib and creating the EAR did not seem to work in this situation.
For the EAR build, I currently have the following directory structures;


When I do my Ant build, the build.xml and MyApp.class are in the MyApp directory while all of my jars are in the jar directory.

My ant for creating the ear looks like:

As I am new to ant as well as EAR files, is there a better way to build the EAR so that the jars are in the appropriate directory?
I have a situation where I have several jars that I want to include in an EAR file. The problem that I am running into is that some of the jar files reference properties in their respective manifests. If I execute the classes and have the appropriate jar files in the classpath, they retrieve the information. But when I create the EAR file, when the classes get called they return null for the values as if the manifest is not in the classpath.

How can I create the EAR using Ant where it will add the classpath information to the manifest of the EAR file?
Examples vary depending on what type of ActiveX control (such as COM+ or UI controls) and which direction you want to communicate (Java-to-ActiveX, ActiveX-to-Java) as well as what tools you are using in conjunction with the ActiveX and Java (some Java Web Servers support ActiveX controls as Java objects).

I do agree that if you can avoid it, don't mix ActiveX (COM) with Java. I am having trouble getting my Java objects to act as COM objects and the Packager documentation that Sun provides is not very helpful.
19 years ago

Originally posted by Tim Struppi:
You mean that I should use something like SOAP?
Is this the easiest way also when both programs runs at the same time on the same mashine?
The performance is no problem because I send only some data (maybe 500 Byte) and want to start methods.
Have I a security problem using SOAP?

I mean that I prefer to use SOAP or a custom serial interface. You should not have a security problem with SOAP on the same system, and if you were using SOAP between multiple systems I would encrypt the data.
19 years ago

I have a java and a VB6 Program. The VB should invoke functions of Java and the other way round. I have both Sourcecodes.
Is this possible and what would be a good solution for this.
(With JavaBeans or COM+ or CORBA...??)

Most of the tools that I have run into allow COM objects to run within the Java Application Server. I personally try to stay away from CORBA, early versions of CORBA between different languages were not always compatible and made communication unreliable. I tend to prefer using serial connections or Web services when communicating between unlike languages, but both of those add the overhead of parsing the message before processing it.
19 years ago
I have looked at many of the so-called Java-COM bridges, and most of them are too expensive for the need (who can afford to spend $2000 (server license) for something that will only be needed for 6 months), do not perform in the manner I need (many are designed to allow COM objects to run in a Java container, I need to run Java objects in a COM+ environment), or they are really Java-to-Socket layers that require you to write a COM-to-Socket object to communicate.

COM+ is supposed to be language independent, however the only Java version that works with COM as far as I can tell is the Microsoft version & VM. I do not use Visual J++, nor do I wish to try to purchase a copy since Microsoft no longer supports it (which means getting them to answer any questions is impossible).

I have experience in writing JNI, I wrote a tool four years ago called JNIBuilder that would create Java/JNI code and create the C++ headers but that does not solve the problem as I would still have to write additional support code.

As I have stated I already have Java code (Javabeans) that already have the functionality that I need to add to my existing COM-based application. The objective is to be able to take the code and generate the TLB and DLL files from the Java code and get them to be able to communicate with the existing COM objects in the appropriate context. The Sun website referenced an ActiveX Bridge, but the documentation did not go into enough detail and when I followed the instructions, several of the COM object properties were not registered (such as MTS enabled, MultiUse, and Multi-Threaded Apartment). Even when I modified the registry entries with those properties I was unable to get the functionality to work. It is my understanding that the ActiveX Bridge was designed for what I am attempting to do, but I am unable to utilize it properly for eny true interfaces (I was able to get the HelloWorld example to work, but not able to get my credit-check code to work). The credit-check Javabean works fine in my Java application and in my JSP/Servlet application so I know the problem is not the Java code.

The way that particular module works is I call the credit check interface with the SSN, FirstName, Lastname and several other parameters and it calls a Web Service to communicate the data to the appropriate Credit Bureau Service, the interface will return an CreditScore object that gets passed back to the UI informing the user of the credit score.

From what I can tell, my ASP pages make the COM+ calls but I do not seem to get any interaction with the Java code. The process times out and the Java code did not log anything. I can take the same Java code and call it directly through a JSP page and I receive the credit score as well as the logging of each interaction.
19 years ago
I have seen lots of examples on how to invoke COM objects from within Java and know that some vendors such as BEA have tools that support using COM objects in a Java environment. I want to be able to utilize my investment in the Java components to add functionality to a legacy COM+ application while I redesign the application.

Current configuration:
Windows 2000
256 Meg RAM
AMD 600Mhz processor
Oracle 8i database
IIS 5.0
JRE 1.4.2_07
IE 6.0
11 COM components

Future Configuration:
256 Meg RAM
AMD 600 Mhz processor
Oracle 8i database
Netscape 7.2
JRE 1.4.2_07
25 Javabeans (most likely will be EJBs)

I would appreciate any explanation on how to make my Java class files run as COM+ components would be helpful. I have heard of several tools to do this, however most of them were designed to run COM components in Java applications and not the other way around. JIntegra looks like it might be useful, however for my current needs it is not a cost effective solution.

19 years ago
I currently have an application which was originally written in Visual Basic using COM+. Eventually I will replace the application with a pure Java solution but for now I want to extend the application using Java and use the Java code as a COM+ object. I stumbled across the Sun ActiveX Bridge, however it did not provide example code on how to communicate between the various Java/COM objects that I will have.

For example I have an ASP page which calls a COM object, the COM object needs to communicate to another COM object how do I do that? The ActiveX Bridge Developer Guide basically states that I write a Javabean, then I jar the bean files and run packager.exe (part of the Sun JRE) to generate a DLL. Then it states that I place the DLL in a directory (for instance; COM_Bean\bin) and place the jar file into another directory (for instance; COM_Bean\lib) and register the DLL.

Can anyone help?
19 years ago
I have a servlet that gets an HTML file that has some GIFs in it. The problem I am encountering is the page is retrieved, but the GIFs are not displaying.
The html page is in jakarta-tomcat-4.0.4/webapps/ROOT
The GIFs are currently in jakarta-tomcat-4.0.4/webapps/ROOT
The html references the GIFs similiar to <img src="myLogo.gif">
On my desktop the images show, however when deployed on the server the images do not show. How can this be corrected?
19 years ago
I have two servlets which communicate to different JSPs. One works as expected, the other does not work at all.
Originally both servlets used getServletContext().setAttribute("inputValue",inPutObj); and the JSPs did a <%=getServletContext().getAttribute("inputValue")%> and both of them worked except that all users received the same value for "inputValue".
To get around this problem, I changed both servlets to use request.setAttribute("inputValue",inPutObj) and changed both JSPs to use <%=request.getAttribute("inputValue")%>, only one of the servlet/jsp pairs works.
The one that does not work is called directly by the servlet name, and only sends data to a JSP in an error situation. The one that does work, is called via a "POST" from an HTML page.
By not working, the JSP shows the word null where it should show my error code. Per my logging, a valid value is placed in inPutObj but does not get to the error.jsp file.
Any help would be appreciated.
19 years ago
I am using HttpSession session = request.getSession(true); in the servlet as well as using the dispatch.forward(request, response); to forward to the JSP.
As stated previously, it was working when I used getServletContext() with the setAttribute and in the JSP's getAttribute, but the problem was that all the JSP's returned the same values. I wanted to limit it to either the session or the request.
The scenario is:
user calls servlet1 via the web browser, if I am unable to retrieve thier data then I set attributes in a custom error.jsp file and forward to user (worked when using getServletContext() to set attributes). If I retrieve data, I send an html file that requests more information and performs a post to a second servlet. In the second servlet, I perform a request.setAttribute("passed",passedObj) and a dispatch.forward(request, response) to a customInfo.jsp file. The customInfo.jsp portion works fine, its the first situation where the first servlet is called that I fail.
19 years ago
I have a servlet that needs to set and attribute that will be retrieved by a JSP.
Originally my servlet code to do that was: getServletContext().setAttribute("passedItem",passedItemObj);

the JSP had the following code: getServletContext().getAttribute("passedItem");
the code worked except for the fact that all sessions retreived the same values. I then modified the code in the servlet to look like the following:
and changed the JSP code to look like the following:
Now I return null values.
I tried to change the servlet to use: session.setAttribute("passedItem",passedItemObj); and the JSP to session.getAttribute("passedItem");
and I still return nulls.
Any suggestions???
19 years ago
I have created a WAR file called myServlets.war using the packager tool.
I have looked in the war and it shows the files in the form of WEB-INF/classes/mypackage/classname.class where the bolded items are my package names and classfile names.
I placed the WAR in the jakarta-tomcat-4.0.4/webapps/ROOT/WEB-INF/lib directory, and restart my server. However I cannot access my servlets, what is wrong?
20 years ago
The use of localhost was used as an example, as was the use of the various IP addresses in my responses.
In one of my latter responses, I did show a sample of test code which I used to test with and it did include the slash.
I have tried the following:
All result in the file not being found in the Tomcat environment.
20 years ago