NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Can't Deploy if i create a second virtual Server on Glassfish

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
Tream84



Joined: 02 Sep 2010
Posts: 1

PostPosted: Thu Sep 02, 2010 3:20 pm    Post subject: Can't Deploy if i create a second virtual Server on Glassfish Reply with quote

hi,

i wanna use my images on an external site, so i decide to create a virtual server on Glassfish V3.

I create it and i can see the images.
But now i can't deploy my Application. Why this happens?

My Settings for the virtual Server:

http://img830.imageshack.us/i/55172212.png/

http://img251.imageshack.us/i/80466192.png/

http://img186.imageshack.us/i/39802561.png/


Now if i click to Deploy or Run on my Netbeans then i get this exception:

Code:

com.sun.faces.config.ConfigurationException:
  Source Document: bundle://157.0:1/com/sun/faces/jsf-ri-runtime.xml
  Cause: Unable to create a new instance of 'com.sun.faces.application.resource.ResourceHandlerImpl': java.lang.NullPointerException
        at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:295)
        at com.sun.faces.config.processor.ApplicationConfigProcessor.setResourceHandler(ApplicationConfigProcessor.java:752)
        at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:310)
        at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
        at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116)
        at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
        at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:223)
        at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:335)
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223)
        at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4664)
        at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:535)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5266)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:499)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1947)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1619)
        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90)
        at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
        at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)
        at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
        at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
        at com.sun.faces.application.resource.ResourceHandlerImpl.<init>(ResourceHandlerImpl.java:91)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:270)
        ... 49 more

SCHWERWIEGEND: PWC1306: Startup of context /WebApplication2 failed due to previous errors
SCHWERWIEGEND: PWC1305: Exception during cleanup after start failed
org.apache.catalina.LifecycleException: PWC2769: Manager has not yet been started
        at org.apache.catalina.session.StandardManager.stop(StandardManager.java:892)
        at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5456)
        at com.sun.enterprise.web.WebModule.stop(WebModule.java:530)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5284)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:499)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1947)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1619)
        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90)
        at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
        at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)
        at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
        at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:619)


If i delete my Virtual Server then it works fine again...
Back to top
thomasH



Joined: 27 Sep 2010
Posts: 2

PostPosted: Mon Sep 27, 2010 9:18 am    Post subject: Reply with quote

Hello Tream84,

Did you already solved your problem?

I have a simular issue. I want to deploy an application directly to a specified
virtual server on glassfish, but I don't know how can I do that.

I have two web applications. One only provide a webservices which should be accessable form the internet and the other one is a comapany internal application which also uses the webservices. My idea is to use two ports on glassfish and I already created a second virtual server and another HTTP-Listener.

Code:
<http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="server" enabled="true" family="inet" id="http-listener-1" port="8080" security-enabled="false" server-name="" xpowered-by="true">
    <property name="proxiedProtocols" value="ws/tcp"/>
    <property name="cometSupport" value="true"/>
</http-listener>
<http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="server" enabled="true" family="inet" id="http-listener-2" port="8181" security-enabled="true" server-name="" xpowered-by="true">
    <ssl cert-nickname="s1as" client-auth-enabled="false" ssl2-enabled="false" ssl3-enabled="true" tls-enabled="true" tls-rollback-enabled="true"/>
</http-listener>
<http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="serverWS" enabled="true" family="inet" id="http-listener-3" port="8282" security-enabled="false" server-name="" xpowered-by="true">
    <property name="proxiedProtocols" value="ws/tcp"/>
    <property name="cometSupport" value="true"/>
</http-listener>
<virtual-server hosts="${com.sun.aas.hostName}" http-listeners="http-listener-3" id="serverWS" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
    <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
    <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
    <property name="sso-enabled" value="false"/>
</virtual-server>
<virtual-server hosts="${com.sun.aas.hostName}" http-listeners="http-listener-2,http-listener-1" id="server" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
    <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
    <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
    <property name="sso-enabled" value="false"/>
</virtual-server>


If I deploy the application to the server, it always is deployed to the standard virtual server "server". If I change the virtual server for the application manually within the management console everything works.
Is there a way how Netbeas can deploy my application directly to the virtual server? (I'm using Netbeans 6.8 with Maven)

Thanks a lot and best regards,
Thomas
Back to top
TD
Posted via mailing list.





PostPosted: Tue Sep 28, 2010 1:31 am    Post subject: Re: Can't Deploy if i create a second virtual Server on Glassfish Reply with quote

Create a new 'server' entry in NB Services, pointing to the new virtual
server with the location localhost:8282

Change the project properties to use the new NB server.

Tony

-----Original Message-----
From: thomasH [mailto:address-removed]
Sent: 27 September 2010 10:19
To: address-removed
Subject: [nbj2ee] Can't Deploy if i create a second virtual Server on
Glassfish

Hello Tream84,

Did you already solved your problem?

I have a simular issue. I want to deploy an application directly to a
specified
virtual server on glassfish, but I don't know how can I do that.

I have two web applications. One only provide a webservices which should be
accessable form the internet and the other one is a comapany internal
application which also uses the webservices. My idea is to use two ports on
glassfish and I already created a second virtual server and another
HTTP-Listener.


Code:
<http-listener acceptor-threads="1" address="0.0.0.0"
blocking-enabled="false" default-virtual-server="server" enabled="true"
family="inet" id="http-listener-1" port="8080" security-enabled="false"
server-name="" xpowered-by="true">
<property name="proxiedProtocols" value="ws/tcp"/>
<property name="cometSupport" value="true"/>
</http-listener>
<http-listener acceptor-threads="1" address="0.0.0.0"
blocking-enabled="false" default-virtual-server="server" enabled="true"
family="inet" id="http-listener-2" port="8181" security-enabled="true"
server-name="" xpowered-by="true">
<ssl cert-nickname="s1as" client-auth-enabled="false"
ssl2-enabled="false" ssl3-enabled="true" tls-enabled="true"
tls-rollback-enabled="true"/>
</http-listener>
<http-listener acceptor-threads="1" address="0.0.0.0"
blocking-enabled="false" default-virtual-server="serverWS" enabled="true"
family="inet" id="http-listener-3" port="8282" security-enabled="false"
server-name="" xpowered-by="true">
<property name="proxiedProtocols" value="ws/tcp"/>
<property name="cometSupport" value="true"/>
</http-listener>
<virtual-server hosts="${com.sun.aas.hostName}"
http-listeners="http-listener-3" id="serverWS"
log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
<property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
<property name="accesslog"
value="${com.sun.aas.instanceRoot}/logs/access"/>
<property name="sso-enabled" value="false"/>
</virtual-server>
<virtual-server hosts="${com.sun.aas.hostName}"
http-listeners="http-listener-2,http-listener-1" id="server"
log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
<property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
<property name="accesslog"
value="${com.sun.aas.instanceRoot}/logs/access"/>
<property name="sso-enabled" value="false"/>
</virtual-server>




If I deploy the application to the server, it always is deployed to the
standard virtual server "server". If I change the virtual server for the
application manually within the management console everything works.
Is there a way how Netbeas can deploy my application directly to the virtual
server? (I'm using Netbeans 6.8 with Maven)

Thanks a lot and best regards,
Thomas
Back to top
thomasH



Joined: 27 Sep 2010
Posts: 2

PostPosted: Tue Sep 28, 2010 10:13 am    Post subject: Reply with quote

Hi Tony,

Thanks for your resonse and your tipp with the secon server.

I tried to add it and I have four options (the admin port for the whole server is still 4848):
Register Local Default Domain: (domain1) I already used it with the standard sever
Register Local Domain: I have to add a new domain folder. If I use the same domain folder the port 4848 will be deteced automatically.
Register Remote Domain: I tried it to use localhost and 8282 as admin port, but I can't start and use the server
Create Personal Domain: I also have to add a domain folder.

Could you describe how I can add the second "virtual" server?

I forgot to say, I'm using Glassfish 2.1.1.
Back to top
TD
Posted via mailing list.





PostPosted: Wed Sep 29, 2010 12:51 am    Post subject: Re: Can't Deploy if i create a second virtual Server on Glassfish Reply with quote

thomasH

I think you are a little confused as to what a virtual server is .. a
glassfish virtual server allows you to access the same glassfish server
different domain names (Internet host names, such as mydomain1.com and
mydomain2.com, assuming your DNS setup points both names to the same IP of
the glassfish server). It's not a separate server, or a different part of
the same server, it's just a alternative way of accessing the same server
using a different address. It DOES allow you to set up different ports and
different default modules, but in your case I don't think that's
appropriate.

When you create a different internal glassfish-domain (NOT a virtual
server!) on the server, you actually run two instances of the server side by
side .... which adds additional load to the machine if both are running on
the same machine.

Since NB is designed as a development environment, I suspect the developers
of NB never thought you'd want to develop using a 'live' server, on which a
production application is already running.

What I suggest is that you create a second instance of glassfish, complete
with a different glassfish_home directory. Develop and test your new
application using that server as a development environment. If it's on the
same machine as the production application, make sure you use a different
port for the listeners to avoid port conflicts .. but then you shouldn't be
on the same machine anyway.

Remember, if the two applications need to work together then you can still
access the web services of the first application, even though you're in a
second instance of glassfish, the same as any consumer of those services
will.

If you absolutely want to use your current idea, then once you are satisfied
its working correctly, clean and build then grab the WAR file, create the
virtual server in the production server, add the http-listeners, then use
autodeploy to load up the application --- to the default domain on the
production server -- and set the default module for the second virtual
server to the internal application. This won't stop people from accessing
the 'internal' application using the 'normal ports' if they know the correct
context though!

In Glassfish, you don't HAVE to use a different internet domain name (host
name) to access the second application .. you can still set the virtual
server Host name to the same default ${com.sun.aas.hostName} .. just set the
default module for the second glassfish virtual server to the name of the
second application.

I also think you're thinking in the wrong direction. Why are you trying to
access the second application using a different port? If it's an internal
application and you want to restrict access using a firewall setup, then
fine, but in that case why not just run it as a separate process (ie a
completely different instance of glassfish)?
Even better, deploy it on a different machine, completely inside your
company firewall.

If you want people to have access to the second application from outside the
corporate firewall, then run it in the production 'external' server, but add
security to it. You just deploy it to the same glassfish domain as the
webservice and access it using the correct context.
ie access the webservice using http:mydomain.com/webservice (or just
http://mydomain.co if it's the default module) and the 'internal'
application using http://mydomain.com/myApp.
You don't have to worry about different ports then at all!

I think it would be a bad idea to use the production environment as a
development environment at the same time.

Tony

-----Original Message-----
From: thomasH [mailto:address-removed]
Sent: 28 September 2010 11:14
To: address-removed
Subject: [nbj2ee] Can't Deploy if i create a second virtual Server on
Glassfish

Hi Tony,

Thanks for your resonse and your tipp with the secon server.

I tried to add it and I have four options (the admin port for the whole
server is still 4848):
Register Local Default Domain: (domain1) I already used it with the standard
sever
Register Local Domain: I have to add a new domain folder. If I use the same
domain folder the port 4848 will be deteced automatically.
Register Remote Domain: I tried it to use localhost and 8282 as admin port,
but I can't start and use the server
Create Personal Domain: I also have to add a domain folder.

Could you describe how I can add the second "virtual" server?

I forgot to say, I'm using Glassfish 2.1.1.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo