Neil Goldsmith

Ranch Hand
+ Follow
since Nov 02, 2001
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 Neil Goldsmith

My first servlet needs to get the data back from the called servlet in the reqID variable as shown in the code. If I use the include call, can the first servlet parse the response from the called servlet? How does it do that?

thanks
18 years ago
I have a servlet that invokes another servlet that runs within Tomcat on the same system:


In short, the call to invoke the other servlet would look like this:
http://myserver:8080/anotherServlet/theMethod

We are now allowing our apps to run under SSL control. However, the calling servlet and the called servlet may or may not be under SSL control. If for instance, the called servlet is under SSL control, the call to invoke it would look like this:
https://myserver:8443/anotherServlet/theMethod

Both the text "https" and the port have to change to properly invoke it.

My question, is there a way to programmatically query to find out if another servlet is under SSL control and to find what port to use? 8443 is the default port in TC, but it can be changed. How would the caller know that?

thanks
[ October 21, 2005: Message edited by: Neil Goldsmith ]
18 years ago
For the JDBC configuration, it asks for the Datasource Helper Classname. It defaults to com.ibm.websphere.rsadapter.GenericDataStoreHelper if you don't put one in. What does this class do? Why would I not just go with the Generic default entry instead of a specific Oracle class? If not the default, what one should I use for Oracle?
18 years ago
Using WAS 5.1, I have a JDBC Provider setup for my Oracle DB.
The driver is ojdbc14.jar (we've tried a few different ones with same result).
driver class: oracle.jdbc.driver.OracleDriver
datasource helper classname: com.ibm.websphere.rsadapter.GenericDataStoreHelper

When I attempt to test this connection inside the WAS admin, I get the following error:
java.lang.Exception: DSRA8101E: DataSource class cannot be used as one-phase: ClassCastException: oracle.jdbc.driver.OracleDriver. View JVM logs for further details. null

I found in a search to set the custom variable enable2Phase to true, but that gives me the same error as above except is says cannot be used as two-phase

Any ideas why this driver does not work, or reasons for this error message?

thx
18 years ago
We have 2 servlets that talk to one another. The first servlet needs to pass a string over to the 2nd as a parameter in a GET request. This string may contain far east Double byte characters (Korean, Japanese, S. Chinese)

We first encode the data using UTF-8. I tested that I could encode and decode this before sending and got back the correct Korean characters.

When I recieve the data by the 2nd servlet, it decodes everything correctly EXCEPT the double byte characters. Those come back as ??? . I have attempted a POST request, but both seem to fail.

My code for the sending servlet looks like this:


The receiving servlet just does this:


Pretty straightforward. Like I said, the decoding works fine unless it is Double Byte characters and then it can't handle them.

Is there anyway to custom parse the parameters myself? It appears the decoding is not working.

Am I doing something wrong? Can you pass double byte characters encoded with UTF-8 this way?

thanks

[ August 05, 2005: Message edited by: Neil Goldsmith ]
[ August 05, 2005: Message edited by: Neil Goldsmith ]
18 years ago
We are using the method javax.servlet.ServletResponse::setCharacterEncoding
in our code. I am using Websphere v. 5.0.0 and that method is not defined, although I thought 5.0.0 supported Servlet spec 2.3?

Does anyone know what version of Websphere that method was supported? We need to set a minimum version for our product and need to use this method, so we want to base it upon that information.

I can't find anything at all on IBM's site about it.

thank you
18 years ago
I'm performing administrative work via JACL scripts in Websphere. I wanted to set my dynamic data into a file and have my JACL scripts pull in that data from the file when setting up the variables. Looking for some sample script code on how to do that.

thanks
18 years ago
I have a servlet that connects to a legacy server via a socket connection. it then reads/writes over this socket. It works fine in Tomcat, but I've ported the servlet over to Websphere and I can't seem to write to the socket. It connects just fine, but when I go to Write, the server never reads anything and I don't have any errors.

The code is pretty simple socket stuff. This part lives in my servlet:


This code lives in my Server which is just a POJO:


Like I said, I don't hit any exceptions. The servlet sends off his message in the write, but the server never gets anything to read in the buffer.

Is this a problem in Websphere? Do I need to configure anything?

thanks
18 years ago
All of our servlets need to obtain a global object via a JNDI lookup and pass it data. The global object then sends a command over a socket connection to a legacy system, gets back a response and sends it back to the servlet. The global object starts up and goes down along with the appserver ( or servlet container) This should work on both Tomcat and Websphere. I've noticed WS is much more restrictive with objects running within the app server, no multiple threading, no sockets, whereas I can do all of that within Tomcat by simply creating a Global JNDI resource defined in server.xml.

I'd like to come up with a general solution that works for both Tomcat and WS. Am I missing something within WS that might allow me to do this? Is there a better solution that will work for both TC and WS?

thx
18 years ago
In porting our Tomcat application over to Websphere, I found a custom service to be what we are looking for, EXCEPT it appears it doesn't allow the use of sockets. Our application running in Tomcat starts/stops when Tomcat does. Its purpose is to connect via a socket to a server. All servlets queue up messages that are then sent over this socket. We are limited to this architecture because of the legacy server we are talking via sockets to.

In looking at Websphere, it appears a custom service is exactly what we need, except I read it doesn't allow the use of sockets. Is there some way around this? Is there another way to create a global object within WS that I can then use a socket connection with?

thx
18 years ago
We have a custom JNDI factory that creates our custom class when Tomcat starts up. It is pretty easy to configure in Tomcat, just requires some content within the server.xml, under the Global Naming Resources section. Then our servlets can do a lookup for the factory and get our custom class.

We want to port this to Websphere 5. I've been looking for documentation about how this is done in WS, but haven't found anything similar. Does anyone have a good reference for doing this? Any tips/hints/code/etc?

thanks
18 years ago
We are using Eclipse, however this is a general question about setting IME input mode.

We want to enable the user to enter far east Character sets into our Eclipse based editor (SWT). Getting the shell of the IEditorSite, we can set the type of input mode like this:
site.getShell().setImeInputMode(SWT.DBCS);

However, when I stepped into this call, it basically does nothing for locales that are not Double Byte:

public void setImeInputMode (int mode) {
checkWidget ();
if (!OS.IsDBLocale) return;
...

I don't follow why it does this. I have a global IME Input bar on my desktop that allows me to enter various characters from different character sets, even though my locale is not DB. Why would the code limit setting the IME input mode to just DB locales?

Next I attempted to change my default locale via the control panel to a far east language, which worked fine, but it still did not consider it a DB locale (I tried Korean, Japanese and Chinese). Would I have to have one of the far east OS's installed for it to work?

Finally (yes, alot of questions ), In our program we create alot of different editors. Is there anywhere we can set the IME Input mode to DBCS just once and have them all inherit that attribute?

Thanks!
18 years ago
In our design, we have a GUI that allows our customers to create tables and rows in those tables on the fly. We want to map these tables to entity beans, but the dilemma is, you don't know ahead of time what the tables/rows will look like, so how do you precreate entity beans that map that data? We also have a very distributed system, so creating entity beans on the fly and mapping them to all the appservers would be challenging.
I was looking for some feedback on possible solutions for this problem.
In the old world, we simply used SQL and pulled table names/rows out of the dynamic data provided by the customer. We want to use entity beans for the added benefits you get from them, but how do you make them dynamic to support a dynamic data model?
WAS Ver 4.0.1 uses Round Robin, Random, Random prefer local and Round Robin Prefer Local.
These settings are configured in the ServerGroup Properties.
21 years ago
We are porting over Windows code to Java and one feature we really loved was the Performance Monitor that windows provided. It allowed you to add your own custom performance items to view in realtime with nice graphics which is something we really want to have.
Is there an equivalent (or better) tool, either freeware or 3rd party that might have similar functions in Java?
We want each developer on our team who develops a component to use our in house performance collection classes. It will be the collection classes that talk to the display which I'm hoping will not have to be custom written in house.
21 years ago