Archive for November, 2005

links for 2005-11-30

links for 2005-11-25

MQJMS1000

I recently ran into this error: IBM - MQJMS1000: Failed to create JMS message and MQJMS2007: failed to send message to MQ queue . The IBM support page says this

Another common cause of MQJMS1000 is that the data has been written in a code page that is not supported by the JVM.

Unfortunately, my resolution was to use the IBM JVM…frustrating, but it works.

Update: The underlying cause of this JMSException was “java.io.UnsupportedEncodingException: Cp437″ The source of the JMS message was an IBM 4690 client and the default file.encoding is Cp437. The rt.jar in the Sun JDK does not support this type of encoding, but it is supported in charsets.jar. So the solution was to add charsets.jar to the classpath.

Scientist and Religion

This entry by Adam Bosworth started me thinking about the scientist/technologist that speaks to religion. I found two very ironic counter examples to Bosworth’s thinking on “reason”, Isaac Newton and Charles Darwin.

Only recently did I learn from Dr. Dale Johnson (listen for yourself, week 3) that Isaac Newton wrote more about religion that he did science. The referenced Wikipedia entry confirms that, and also quotes Newton as saying, “I have a fundamental belief in the Bible as the Word of God, written by those who were inspired. I study the Bible daily.” and “Gravity explains the motions of the planets, but it cannot explain who set the planets in motion. God governs all things and knows all that is or can be done.”

On the other hand, Charles Darwin, author of the most influential book in biology, would quote the Bible on moral issues, but later in life rejected the Bible. In his own words: “my judgment often fluctuates…In my most extreme fluctuations I have never been an Atheist in the sense of denying the existence of a God. I think that generally (and more and more as I grow older), but not always, that an Agnostic would be the more correct description of my state of mind.”

I think that most would agree that both Isaac Newton and Charles Darwin have had an infinately greater impact on science and technology than Adam Bosworth. I’m not suggesting that Bosworth can’t voice his opinions…after all Adam Bosworth has had an infinately greater impact on technology that me…but I think that his comments require perspective, especially since he sells himself as a historian.

Intelligent people can come to very different conclusions, and this is why I’m so surprised when scientist quickly dismiss intelligent design. After all, aren’t observation and the fomulation of an hypothesis a key steps in the scientific method? No one was present to observe the creation of our world, so we are left to speculate. Credible scientist do concede that the universe has been “fine tuned.”

Understanding Google Base

If you want to get an insider’s understanding of the why behind base.google.com, listen to Adam Bosworth discuss Database Requirements in the Age of Scalable Services at the MySQL Users Conference. The short is relational databases don’t scale to the universe, but a simple XML/RSS database does.

Russell Beattie has similar thoughts.

How To Write Unmaintainable Code

From /., How To Write Unmaintainable Code

My favorite technique,

Use Plural Forms From Other Languages
A VMS script kept track of the “statii” returned from various “Vaxen”. Esperanto , Klingon and Hobbitese qualify as languages for these purposes. For pseudo-Esperanto pluraloj, add oj. You will be doing your part toward world peace.

Lie in the comments
You don’t have to actively lie, just fail to keep comments as up to date with the code.

Document the obvious
Pepper the code with comments like /* add 1 to i */ however, never document wooly stuff like the overall purpose of the package or method.

Document How Not Why
Document only the details of what a program does, not what it is attempting to accomplish. That way, if there is a bug, the fixer will have no clue what the code should be doing.

Public Schools Should Raise Your Children

That’s according to the US Court of Appeals for the 9th Circuit judges Donald P. Lay, Stephen Reinhardt, and Sidney R. Thomas in this ruling.

We agree [with the previous ruling], and hold that there is no fundamental right of parents to be the exclusive provider of information regarding sexual matters to their children, either independent of their right to direct the upbringing and education of their children or encompassed by it. We also hold that parents have no due process or privacy right to override the determinations of public schools as to the information to which their children will be exposed while enrolled as students. Finally, we hold that the defendants’ actions were rationally related to a legitimate state purpose.

It’s scary to think that intelligent people can come to that conclusion. The ruling clearly states that the parents of the elementary school children (ages 7 to 10) were notified of the survey but were misled about the contents of the survey. The notification did not explicitly state that the children were to be surveyed about the children’s sexual activity. When the 6 parents of students protested, the court came to the above conclusion.

It is disturbing that the public school system, funded by tax payer money, can exercise such extreme control. It would seem that the public school system is most beneficial when the system works with the parents, not against the parents. It is especially disturbing because students of history will remember that the Nazi party was particularly good at controlling the German education system. I don’t mean to imply that the Palmdale school district is a Nazi organization, just that everyone school be concerned when an organization tries to deceptively control the education of children.

More in in this WorldNetDaily story.

links for 2005-11-18

links for 2005-11-16

JMS and WebSphere MQ

Recently, it was a real pain to write a JMS client to a WebSphere MQ 6 server. The problem was that by default, the MQ implementation of the ConnectionFactory underlying JMS uses the “bindings” settings, which is the MQ term for localhost communication. My client was on a seperate machine, and I didn’t want to use LDAP because it seemed too heavy for my application. Depsite my searches on ibm.com/developer, I didn’t find a single example.

Finally, after much digging on IBM’s site, I found the JMS-MQ bible on this page. It is WebSphere MQ Using Java. This manual is actually very good.

My resulting code for configuring the ConnectionFactory as a client is

	public ConnectionFactory getConnectionFactory() throws JMSException,
			NamingException {

		ConnectionFactory cf = null;
		AppProps prop = AppProps.getInstance();

		if (useJNDI) {
			if (jndiContext == null)
				jndiContext = new InitialContext();

			String connFactory = prop.getProperty("connection_factory");
			cf = (ConnectionFactory) jndiContext.lookup(connFactory);

		} else {
			String hostname = prop.getProperty("host");
			int port = Integer.parseInt( prop.getProperty("port") );
			String qmgr = prop.getProperty("qmgr");
			String channel = prop.getProperty("channel");
			MQQueueConnectionFactory connectionFactory =
                            new MQQueueConnectionFactory();

			connectionFactory
                              .setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
			connectionFactory.setQueueManager(qmgr);
			connectionFactory.setHostName(hostname);
			connectionFactory.setChannel(channel);
			connectionFactory.setPort(port);

			cf = connectionFactory;
		}

		return cf;
	}

The important line is connectionFactory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);.

The real frustration in all of this is that I had no problem doing the same thing with ActiveMQ.

Next Page »