arnold yan

Ranch Hand
+ Follow
since May 31, 2002
Merit badge: grant badges
For More
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 arnold yan

Does anyone knows how to create a client jar for an EJB inside Jbuilder 2005? I remember I was able to do it with earlier versions of Jbuilder, but I can not find this functionality in Jbuilder 2005.

Thanks for your advice.

Arnold
Hi,

I am trying to find out whether it is possible to build conditional xsd schemas. For example, whether element A is required or optional depends on the value of element B.

Can someone point me to the right direction? I am not very familiar with xsd.

Thanks!
I tried to start nodemanager in UNIX environment. My admin server and managed servers were setup to use Java Standard Trust Keystore. But I got the following error

<Error> <NodeManager@xx.x.xxx.xx:5555> <There are no trusted CAs in keystore /opt/appl/BEA/home81/jdk141_02/jre/lib/security/cacerts>

I checked the "cacerts" file. It has 32 bytes. Can someone tell me what could be the problem?

Thanks a lot!
17 years ago
I'm using jdk 1.4, so loadFromXML is not available. Is there any other way that I can still use properties and get around this encoding mess?

Thanks.
17 years ago
I'm writing a password verification utility. I want to create a properties file with all users and their passwords in name/value pairs, such as
user1=password1, where password is encrypted with 3DES. I added following entry in the properties file named "users.properties"

tom=A������A�U��

but when I tried to retireve the encrypted password using following code,

Properties users = new Properties();
users.load(new FileInputStream("c://users.properties"));
String password = users.getProperty("tom");

The string returned is A�??��?A�U��, which is different than what is in the file and can not be decrypted.

The weird thing is, if I use the following code to pull the password,

BufferedReader bf = new BufferedReader(new InputStreamReader(new FileInputStream("c://users.properties")));
String line = bf.readLine();
password = line.substring(line.indexOf("=") + 1);

I got the same password as what is in the file - A������A�U��.

Can someone tell me what is going on?

Thanks!
17 years ago
Hi, I am new to Weblogic. This may be a real newbie question.
I deployed my servlet to 4 managed servers. The servers listen on different ports. My question is, how can the client utilize the load balancing, since he can only hit one specific managed server at a time? I heard the term "virtual host". Is it something I need to configure on weblogic server?

Thanks for your help.
17 years ago
I'm writing a java client that communicates with a servlet. But my client does not seem to hit the servlet, yet I can hit the servlet directly from a browser. Can anyone see what is wrong in my program?

Servlet
--------------------------------------------------
package cswebapp;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class Agent extends HttpServlet {
private static final String CONTENT_TYPE = "text/html";

//Initialize global variables
public void init() throws ServletException {
}

//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
BufferedReader is = new BufferedReader( new InputStreamReader( request.getInputStream() ));
String line = is.readLine();
while (line != null) {
System.out.println(line);
line = is.readLine();
}
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>Agent</title></head>");
out.println("<body bgcolor=\"#ffffff\">");
out.println("<p>The servlet has received a " + request.getMethod() +
". This is the reply.</p>");
out.println("</body>");
out.println("</html>");
out.close();
}

//Process the HTTP Post request
public void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
doGet(request, response);
}

//Clean up resources
public void destroy() {
}
}
-----------------

client
-------------------------------------------------
package client;

import java.net.*;
import java.io.PrintWriter;
import java.io.ObjectOutputStream;


public class UrlClient {
public UrlClient() {
}

public static void main(String[] args) {
String urlString = "http://localhost:7001/CS/agent";
try {
URL url = new URL(urlString);
URLConnection urlConn = url.openConnection();
urlConn.setDoOutput(true);
urlConn.setDoInput(true);
urlConn.setUseCaches(false);
urlConn.setDefaultUseCaches(false);
urlConn.setRequestProperty ("Content-Type", "text/html");

PrintWriter pWriter = new PrintWriter(urlConn.getOutputStream());

pWriter.println("test string");

pWriter.flush();
pWriter.close();

} catch (Exception e) {

}
}
}
----------------------------------

Thanks a lot!
17 years ago
Did you specify your message bundle file in the web.xml? Something like this,

<init-param>
<param-name>application</param-name>
<param-value>struts.YourMessageBundleFile</param-value>
</init-param>
17 years ago
For the sake of clarification, the two web apps are sitting on different boxes.

Arnold
18 years ago
Hi, this seems to be a long one, please bear with me,

I have jsp A, servlet B running on web app 1, and jsp C and servlet D running on web app2.

jsp A invokes servlet B, then B opens a URLConnection to servlet D, and writes some information through the connection. servlet D reads the information through the connection and invokes jsp C, passing .

My question is, how do I delegate control from jsp A over to jsp C? I believe once the URLConnection is closed, the control is still on servlet B of app 1. If I use response.sendRedirect to invoke servlet D after I close the URLConnection, the information I passed through URLConnection will be lost because my request will probably be handled by a new thread of servlet D, correct?

I can not use sendRedirect to pass the information because it is likely to run out of limit.

Thanks for your help.

Arnold
18 years ago
The returned HashMap contains objects such as String, Character, Double, ArrayList, Integer and Exception. All of the data types are defined in jdk. No third party ADT is used. I don't believe class loading is a factor in this case.

Arnold
OK. Let me restate my original problem.

My local client runs on my PC (JVM1), it calls a remote EJB (JVM2), getting a hashmap back, able to serialize it.

I put my client inside another EJB (JVM3), it calls the same remote EJB (JVM2), getting the same hashmap back, not able to serialize it.

None of the EJBs runs on the same app server. Each component runs on a diferrent JVM.

Arnold
To make the case clear, it works fine in a local client, and it does not work in an EJB. The code is exactly the same, it is where I make the call from makes the difference. This should clearly rule out the possibility of serialization issue, don't you agree?

fyi, I reduced the hashmap size by filtering out some entries I don't need.

Arnold
Thanks folks for the help. I believe I finally found the problem. It seems to be some internal problems with BEA. I reduced the size of return HashMap from 15k to 4k and then it worked fine when I made an EJB to EJB call. I would think there are something configurable inside BEA to allow me getting large amount of data via EJB calls. I searched deployment descriptors but had no luck.

Arnold