I'm trying to use the embedded Glassfish for running some unit tests. I have managed to configure and start the server, but i can't access the management console from my browser. Nor can i access the REST Interface from tha java code. My questions are: Is it possible to access the embedded Glassfish server from the browser or from java code, using REST? If it is, what i am doing wrong?
The code is use is this:
File installDir = new File("e:\\Glassfish3\\glassfish");
File domainDir = new File(installDir, "domains\\domain1");
File domainConfig = new File(domainDir, "config");
File domainXml = new File(domainConfig, "domain.xml");
Server.Builder builder = new Server.Builder("test");
EmbeddedFileSystem.Builder efsb = new EmbeddedFileSystem.Builder();
efsb.installRoot(installDir);
efsb.instanceRoot(domainDir);
efsb.configurationFile(domainXml);
EmbeddedFileSystem efs = efsb.build();
builder.embeddedFileSystem(efs);
Server server = builder.build();
server.createPort(4849);
server.addContainer(ContainerBuilder.Type.web);
server.start();
Thanks a lot!