Yes, I see this error before myself, and did the same tracing. Instead of patching the code, I just created the connector externally (instead of calling createConnector). That may not be the right thing to do though. Strangely that so many things that works with the version 5.028 is broken in 5.5.4 (in term of source compatibility). I think the problem with developers is lack of concrete documentation on this area. I am not sure if there is anything that I missed, but I couldn't find much information, other than API. Searching the web, you'll find a few tutorials on how to do this. However, these stuff are very basic, and all based on 5.0x versions. I am afraid of the amount of testing and the number of people is using the embedded is low. If an "http" protocal is missed from an http web container, then what else could be missed?
Peik Feng wrote:
Hi, I'm getting the following error when trying to run Embedded tomcat v5.5.4 (I have modified Embedded.java to print out the error)
java.lang.NullPointerException at org.apache.tomcat.util.IntrospectionUtils.setProperty(IntrospectionUt ils.java:267) at org.apache.catalina.startup.Embedded.createConnector(Embedded.java:41 6) at org.apache.catalina.startup.Embedded.createConnector(Embedded.java:35 7)
When I furthur trace Embedded.java, I found that the error is cause by the following if else statement where it do not consider the case for protocol.equals("http"), causing connector remain as null
public Connector createConnector(String address, int port, String protocol) { ... if (protocol.equals("ajp")) { connector = new Connector("org.apache.jk.server.JkCoyoteHandler"); } else if (protocol.equals("memory")) { connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler"); } else if (protocol.equals("https")) { connector = new Connector(); connector.setScheme("https"); connector.setSecure(true); // FIXME !!!! SET SSL PROPERTIES } ... }
As a workaround, I have added the following and it works properly:
else if (protocol.equals("http")) { connector = new Connector(); connector.setScheme("http"); connector.setSecure(false); }
Hope to get advice from all tomcat user regarding the issue and the resolution.
Thank you
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
