I think this change broke the standalone itests. When I start them I
get the errors after this message. If you want to try it for
yourself, build the server with assemblies (mvn clean install -
Dmaven.test.skip -Dassemble) and run "ant test" in the assembly/test
directory.
-dain
itests.openejb.run:
[java] _________________________________________________
[java] |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
[java]
[java] Running EJB compliance tests on Remote Server
[java] _________________________________________________
[java] WARNING: No test suite configuration file specified,
assuming system properties contain all needed information. To specify
a test suite configuration file by setting its location using the
system property "openejb.testsuite.properties"
[java] Cannot start the test database:
java.lang.IllegalStateException Cannot create initial context:
javax.naming.ConfigurationException Property value for
java.naming.provider.url invalid: 127.0.0.1:4201:Illegal character in
scheme name at index 0: 127.0.0.1:4201
[java] java.lang.IllegalStateException: Cannot create initial
context: javax.naming.ConfigurationException Property value for
java.naming.provider.url invalid: 127.0.0.1:4201:Illegal character in
scheme name at index 0: 127.0.0.1:4201
[java] Cannot initialize the test environment:
java.lang.IllegalStateException Cannot create initial context:
javax.naming.ConfigurationException Property value for
java.naming.provider.url invalid: 127.0.0.1:4201:Illegal character in
scheme name at index 0: 127.0.0.1:4201
[java] at
org
.apache.openejb.test.HsqldbTestDatabase.start(HsqldbTestDatabase.java:
178)
[java] at
org.apache.openejb.test.TestManager.start(TestManager.java:88)
[java] at
org.apache.openejb.test.TestRunner.start(TestRunner.java:188)
[java] at
org.apache.openejb.test.TestRunner.main(TestRunner.java:86)
[java] at org.apache.openejb.test.Main.main(Main.java:31)
[java] Caused by: javax.naming.ConfigurationException: Property
value for java.naming.provider.url invalid: 127.0.0.1:4201:Illegal
character in scheme name at index 0: 127.0.0.1:4201 [Root exception is
java.net.URISyntaxException: Illegal character in scheme name at index
0: 127.0.0.1:4201]
[java] at
org
.apache.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:
145)
[java] at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
[java] at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
[java] at javax.naming.InitialContext.init(InitialContext.java:
223)
[java] at
javax.naming.InitialContext.<init>(InitialContext.java:197)
[java] at
org
.apache.openejb.test.HsqldbTestDatabase.start(HsqldbTestDatabase.java:
176)
[java] ... 4 more
[java] Caused by: java.net.URISyntaxException: Illegal character
in scheme name at index 0: 127.0.0.1:4201
[java] at java.net.URI$Parser.fail(URI.java:2816)
[java] at java.net.URI$Parser.checkChars(URI.java:2989)
[java] at java.net.URI$Parser.checkChar(URI.java:2999)
[java] at java.net.URI$Parser.parse(URI.java:3015)
[java] at java.net.URI.<init>(URI.java:578)
[java] at
org
.apache.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:
125)
[java] ... 9 more
[java] Cannot create initial context:
javax.naming.ConfigurationException Property value for
java.naming.provider.url invalid: 127.0.0.1:4201:Illegal character in
scheme name at index 0: 127.0.0.1:4201
[java] Java Result: 2
On Mar 7, 2008, at 4:04 PM, David Blevins wrote:
Good change!
On Mar 7, 2008, at 12:58 PM, [EMAIL PROTECTED] wrote:
+ // TODO: Move the check to a place where it really
belongs - ConnectionManager, ConnectionFactory or such
+ // This class doesn't really know what is
required as far as connection details go
Definitely. On this note, we should only default the port to 4201
if the protocol is ejbd. Http and https are supported and each has
it's own default port.
+
+ int colonIndex = serverURI.indexOf(":");
+ int slashesIndex = serverURI.indexOf("//");
+ // hostname only
+ if (colonIndex == -1 && slashesIndex == -1) {
+ serverURI = "ejbd://" + serverURI + ":4201";
+ } else if (colonIndex == -1) {
+ serverURI = serverURI + ":4201";
+ } else if (slashesIndex == -1) {
+ serverURI = "ejbd://" + serverURI;
}
We could likely keep the part that defaults the protocol here, then
leave the port defaulting to the ConnectionFactory for that
protocol. For ejbd that's the SocketConnectionFactory, which maybe
should be renamed to EjbdConnectionFactory now that I think of it.
-David