Win a copy of Spring Boot in Practice this week in the Spring forum!

Matthew X. Brown

Ranch Hand
+ Follow
since Nov 08, 2000
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 Matthew X. Brown

We are running WAS 5.0 and Websphere Commerce 5.6. Commerce requires that version 1.1 EJB- which means we do not have the ability to do MDBs. Another requirement is that commerce db connections are not XA enabled. Without doing some serious hacking- How can I execute JMS code so that it is not considered transactional by the EJB container? I'm currently getting "An illegal attempt to use multiple resources that have only on-phase capabiity has occurred within a global transaction." When I attempt to run the JMS code from within a session bean. I am simply trying to put a message to the queue, NOT listen to the queue.

I already tried setting transaction attribut to "Not supported"- but to no avail.

Thank you

17 years ago
I'm using the current SOAP implementation as provided by sun/java. I cannot seem to authenticate through our proxy. When I run my program from home, where I don't have a proxy server, the program successfully connects to a webservice... I've tried using the -Dhttp parameters to pass in- but to no avail. I'm using the to store the http proxy stuff- but it doesn't seem to work. Please let me know if you see anything in my code....
(Please note that I've perused the forums looking for an answer already to my question, and although I have found and tried many of the solutions, none have worked. So just to let you know, I've done some upfront work on this.....Here goes.......)
import javax.xml.soap.*;
import javax.activation.*;
import javax.naming.*;
import java.util.*;
import javax.xml.*;
import javax.xml.messaging.*;
import javax.xml.soap.*;
import javax.xml.parsers.*;
import org.w3c.dom.Document;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import com.sun.xml.messaging.jaxm.soaprp.*;
import java.util.*;
public class WebServiceSendCmd {
private ProviderConnectionFactory pcf;
private ProviderConnection pc;
private MessageFactory mf = null;
private String from ="";
private String to = "";
private String data = "";
MessageFactory messageFactory;
public void Execute() {
public java.lang.String GetXml(java.lang.String argFileName) {
return null;
ArrayList SendMessage(AsnDto dto, EndPointConfiguration configEnd) { ArrayList list = new ArrayList();
System.out.println("SENDING MESSAGE");
SOAPConnection con;
//get parser factory (uses contextclassloader)
this.messageFactory = MessageFactory.newInstance();

SOAPMessage soapMessage = messageFactory.createMessage();
String soapAction = "";
SOAPPart soapPart = soapMessage.getSOAPPart();
SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
SOAPBody soapBody = soapEnvelope.getBody();
SOAPConnectionFactory soapFactory = SOAPConnectionFactory.newInstance();
SOAPConnection soapConnection = soapFactory.createConnection();
URLEndpoint pt = new URLEndpoint(configEnd.getUrl());
String host = "";
String userid = new sun.misc.BASE64Encoder().encode("UserName".getBytes());
String password = new sun.misc.BASE64Encoder().encode("password".getBytes());
java.util.Properties props = new Properties();
Properties systemProps = System.getProperties();
Enumeration iter = props.propertyNames();
while (iter.hasMoreElements()) {
String s = (String) iter.nextElement();
systemProps.put(s, props.getProperty(s));
System.out.println(s+" "+props.getProperty(s));
Enumeration iter2 = System.getProperties().propertyNames();
while (iter2.hasMoreElements()) {
System.out.println((String) iter2.nextElement());
SOAPMessage replyMsg =,pt);
Iterator i = replyMsg.getSOAPBody().getAllAttributes();
SOAPBody returnBody = replyMsg.getSOAPBody();
String xmlNode =;
MimeHeaders mimeHeaders = replyMsg.getMimeHeaders();
Iterator mimeList = mimeHeaders.getAllHeaders();
}catch(Exception e){
return list;
18 years ago
We're currently having an internal debate at my company concerning how to handle requests and responses for services. One of the opinions is that we can send out a "standard" document, which transfers needed data in the standard document required for processing, and the process runs, then populating the some attributes following processing. All of the attributes are populated after the service runs through the document For example:
<service id="performTransfer" requestId="120003">
<stockTransfer flag="" valid="" invalid="" errorText="">AGC</stockTransfer>
<numberofshares flag="" valid="" invalid="" errorText="">100</numberofshares>
<ordertotal flag="" valid="" invalid="" errorText="">1000000<ordertotal>
<option name="debitAccount" success=""/>
<option name="sendEmail" success=""/>
<service id="performTransfer" requestId="120003">
<stockTransfer flag="Y" valid="Y" >AGC</stockTransfer>
<numberofshares flag="Y" invalid="N" errorText="Number of shares exceeds limit">100</numberofshares>
<ordertotal flag="Y" valid="Y">1000000<ordertotal>
<option name="debitAccount" success="N"/>
<option name="sendEmail" success="Y"/>

The other opinion is that we have separate request and response documents. The request provides data needed for processing it. The response sends back the status of the items and the results of processing.
<serviceRequest id="performTransfer" requestId="120003">
<option name="debitAccount"/>
<option name="sendEmail"/>
<serviceResponse id="performTransfer" requestId="120003">
<stockTransfer flag="Y" valid="Y" >AGC</stockTransfer>
<numberofshares flag="Y" invalid="Y" errorText="Number of shares exceeds allowable number">100</numberofshares>
<ordertotal flag="Y" valid="Y" >1000000<ordertotal>
<option name="debitAccount" success="/>
<option name="sendEmail"/>

Seems to me like the intent of the messages is clearer with option #2- but maybe i'm being too strict on this. I suppose that you could infer the intent of the message by looking to see if the valid/invalid flags are set. Let me know any thoughts.........
18 years ago
Are you behind a firewall? If so go to Window/Preferences/Internet in WSAD- put in your proxy server information. Then re-try it.
19 years ago
I'm using the command line startup parameter of -xrunhprof for use with HAT(Heap Analysis Tool from Sun). In order for the Heap Dump to get printed to the file, I need to be able to do the equivalent of a Control Break within Websphere. When I use XMLConfig shutdown- it doesn't seem to work- same thing with doing a "hard" shutdown of the websphere instance(via the control panel shutdown of the W2K service).
How would I issue the command for the system to come down that is equivalent to control break from within a simple java program?
Thanks in advance.
19 years ago
I would say that you do factories within the ObjectToTest class- but I was "projecting" that he doesn't want to change his ObjectToTest at all. If he doesn't mind changing his existing class- Factories are a good way of doing the mock objects(however the mock object implementation must call verify unto itself I'd think). I don't know how we'd get the handle to the actual mock object within the class to verify stuff.
Regarding the term "robust" I guess I simply meant that you can put alot more detail behind the way that the classes/objects are interacting- not that you can't describe that with CRC cards- its just more formalized within UML. You guys are correct- UML isn't a silver bullet- I just wanted to see how I could marry the two(XP/UML).
Factory won't solve his problem. Since his ObjectToTest directly instantiate the classes needed to be mocked(ie. they are strong typed)- factories won't make a difference. His issue is access.
The only way you could get access to test is possibly using AspectJ- via a crosspoint. Checkout Nicholas Lesiecki's article -,t=gr
AspectJ does have a learning curve, so unless you already know it- I would spend my time refactoring the code. However Nicholas Lesiecki is confronting the problem you are having directly- he doesn't want to change existing code to accomodate testing.
Regarding refactoring- My 2cents on that is to consider making your API's accessible via Interfaces- passing in mock objects directly via Smart Handler is good- doing it with an Interface Structure in place will even be better, if not easier.
There seems to be alot of value in creating UML to ensure that the understanding of the system and requirements are clear. However, in XP- it seems that the only tools to model with are CRC cards, which are Ok- but aren't as robust as UML. Where does UML fit in with XP?
I have a tool called "RefactorIt"- and believe me-
don't use it. Maybe its evolved since I "won" fully licenced version about a year ago, but its not a very good tool. I use Eclipse for refactoring now.
I developed CMP Beans on WAS 3.5 using TDD- it was kinda silly- because so much of the code is generated for you(just like in Xdoclet)- by Visual Age/WSAD. Its a little different doing point and click type development with TDD- maybe with the exception of custom finders(which you need to hand code). However, the Junit tests that were derived as a result were valuable-I could change the CMP- then tweak the Junit class and run it- and know that my code was solid. I guess that is true wherever Junit is used....
Ok- Let me preface this by saying that we are not looking at options for doing persistent sessions in general- only selected data we want to persist.
That being said, we're looking at designing a way to persist selected cookies(I use the "cookie" term to differentiate from other "session" type objects) items into the database so that the person's web experience is more customized or personal. So basically we'd have their cookie data saved to the database. We can pretty easily do this via an EJB- probably via an entity bean associated with their userid, fronted with a Session Facade(stateless) Bean- that actually talks to the controller. Are there any patterns that might fit these requirements better than others? I envision a "cookie" field with delimiters basically tagging name value pairs within the field in the database. We setup a standard set and get utiliity methods to parse the name value pairs.
We want it to be general enough to use corporate wide for a variety of J2EE apps. So the name value pairs need to be customizable. I could serialize a HashMap to the database,(as a blob) but ths violates the "pragmatic programmer's" rule of persisting things in "plain text" where possible(for maintainability and migratability(is that a word?).
The nature of the data on the http sessions will be simple plain text items, such as-last order number.
I could code this thing pretty quick, but I just want to see what your opinions are.....
Not being really on top of the JSR process-are there any JSRs currently that are geared towards Ant type tools?
19 years ago
I've been having problems integrating my ant builds with my sourceforge project. I want to pull from the CVS on the sourceforge server- has anyone been able to do this? I guess one of the problems is my firewall configuration, but are there ways of combining tasks to get a proxy authentication,so that I can pull in the source?

Thanks in Advance.
19 years ago
Sorry-I grabbed the wrong text....
<description><![CDATA[Generated by XDoclet]]></description>
19 years ago