Re: WebappLoader vs WebappClassLoader

2015-04-21 Thread Thusitha Thilina Dayaratne
Hi

  Could someone tell me what is the purpose of having WebappLoader and
  WebappClassLoader in Tomcat?
 WebappLoader is the Tomcat object that a user can configure that
 represents the class loader. It remains the same across web application
 stop/start.

 WebappClassLoader is the actual class loader. Every time the web
 application is started, a new instance is created and used.

  As I understand WebappClassLoader is per web application and
WebAppLoader
 for
  tomcat server instance. Am I wrong?
 Yes.
 Thanks for the quick explanation.
 So it means WebappClassLoader and WebAppLoader both are per web
 application.
 In tomcat 7 we were able to add repository to the class loader using
 WebAppClassLoader.addRepository()

This is replaced in favor of the new resource implementation.
Check this [1] and this [2].
Thanks for quick response.
I will look into them :)

Best Regards

2015-04-21 12:02 GMT+05:30 Violeta Georgieva violet...@apache.org:

 Hi,

 2015-04-21 6:42 GMT+03:00 Thusitha Thilina Dayaratne 
 thusithathil...@gmail.com:
 
  Hi,
 
   Could someone tell me what is the purpose of having WebappLoader and
   WebappClassLoader in Tomcat?
  WebappLoader is the Tomcat object that a user can configure that
  represents the class loader. It remains the same across web application
  stop/start.
 
  WebappClassLoader is the actual class loader. Every time the web
  application is started, a new instance is created and used.
 
   As I understand WebappClassLoader is per web application and
 WebAppLoader
  for
   tomcat server instance. Am I wrong?
  Yes.
  Thanks for the quick explanation.
  So it means WebappClassLoader and WebAppLoader both are per web
  application.
  In tomcat 7 we were able to add repository to the class loader using
  WebAppClassLoader.addRepository()

 This is replaced in favor of the new resource implementation.
 Check this [1] and this [2].

 Regards,
 Violeta

 [1] http://tomcat.apache.org/migration-8.html#Web_application_resources
 [2] http://tomcat.apache.org/tomcat-8.0-doc/config/resources.html

  So in Tomcat 8 if we wanna add repositories to the classloader we should
  done that trough the WebAppLoader not with WebAppClassLoader?
  Please correct me if I'm wrong.
 
  Thanks
  Best Regards
 
  2015-04-21 1:51 GMT+05:30 Mark Thomas ma...@apache.org:
 
   On 20/04/2015 14:22, Thusitha Thilina Dayaratne wrote:
Hi,
   
Could someone tell me what is the purpose of having WebappLoader and
WebappClassLoader in Tomcat?
  
   WebappLoader is the Tomcat object that a user can configure that
   represents the class loader. It remains the same across web application
   stop/start.
  
   WebappClassLoader is the actual class loader. Every time the web
   application is started, a new instance is created and used.
  
As I understand WebappClassLoader is per web application and
   WebAppLoader for
tomcat server instance. Am I wrong?
  
   Yes.
  
   Mark
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
   For additional commands, e-mail: users-h...@tomcat.apache.org
  
  
 
 
  --




--


Re: WebappLoader vs WebappClassLoader

2015-04-21 Thread Violeta Georgieva
Hi,

2015-04-21 6:42 GMT+03:00 Thusitha Thilina Dayaratne 
thusithathil...@gmail.com:

 Hi,

  Could someone tell me what is the purpose of having WebappLoader and
  WebappClassLoader in Tomcat?
 WebappLoader is the Tomcat object that a user can configure that
 represents the class loader. It remains the same across web application
 stop/start.

 WebappClassLoader is the actual class loader. Every time the web
 application is started, a new instance is created and used.

  As I understand WebappClassLoader is per web application and
WebAppLoader
 for
  tomcat server instance. Am I wrong?
 Yes.
 Thanks for the quick explanation.
 So it means WebappClassLoader and WebAppLoader both are per web
 application.
 In tomcat 7 we were able to add repository to the class loader using
 WebAppClassLoader.addRepository()

This is replaced in favor of the new resource implementation.
Check this [1] and this [2].

Regards,
Violeta

[1] http://tomcat.apache.org/migration-8.html#Web_application_resources
[2] http://tomcat.apache.org/tomcat-8.0-doc/config/resources.html

 So in Tomcat 8 if we wanna add repositories to the classloader we should
 done that trough the WebAppLoader not with WebAppClassLoader?
 Please correct me if I'm wrong.

 Thanks
 Best Regards

 2015-04-21 1:51 GMT+05:30 Mark Thomas ma...@apache.org:

  On 20/04/2015 14:22, Thusitha Thilina Dayaratne wrote:
   Hi,
  
   Could someone tell me what is the purpose of having WebappLoader and
   WebappClassLoader in Tomcat?
 
  WebappLoader is the Tomcat object that a user can configure that
  represents the class loader. It remains the same across web application
  stop/start.
 
  WebappClassLoader is the actual class loader. Every time the web
  application is started, a new instance is created and used.
 
   As I understand WebappClassLoader is per web application and
  WebAppLoader for
   tomcat server instance. Am I wrong?
 
  Yes.
 
  Mark
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


 --


Re: WebappLoader vs WebappClassLoader

2015-04-21 Thread Thusitha Thilina Dayaratne
Hi,

  Could someone tell me what is the purpose of having WebappLoader and
  WebappClassLoader in Tomcat?
 WebappLoader is the Tomcat object that a user can configure that
 represents the class loader. It remains the same across web application
 stop/start.

 WebappClassLoader is the actual class loader. Every time the web
 application is started, a new instance is created and used.

  As I understand WebappClassLoader is per web application and
WebAppLoader
 for
  tomcat server instance. Am I wrong?
 Yes.
 Thanks for the quick explanation.
 So it means WebappClassLoader and WebAppLoader both are per web
 application.
 In tomcat 7 we were able to add repository to the class loader using
 WebAppClassLoader.addRepository()

This is replaced in favor of the new resource implementation.
Check this [1] and this [2].
Previous Implementation was

@Override
protected void startInternal() throws LifecycleException {

..
for (String repository : 
webappClassloadingContext.getProvidedRepositories()) {
addRepository(repository);
}
super.startInternal();
..
}

Now I tried to add the required repositories as follows now

@Override
protected void startInternal() throws LifecycleException {
..
if(webappClassloadingContext.getProvidedRepositories().length  0){
File dir = new
File(webappClassloadingContext.getProvidedRepositories()[0]);
WebResourceRoot resources = getContext().getResources();
resources.addJarResources(new DirResourceSet(resources,
/WEB-INF/lib, dir.getAbsolutePath(), getContext().getPath()));
getContext().setResources(resources);
}
super.startInternal();
..
}

But I'm getting

org.apache.catalina.LifecycleException: Failed to start component
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/jaxrs_basic]]
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
 at
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
 at
 org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:344)
 at
 org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:189)
 at
 org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWebappDeployment(TomcatGenericWebappsDeployer.java:258)
 at
 org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWarWebappDeployment(TomcatGenericWebappsDeployer.java:207)
 at
 org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleHotDeployment(TomcatGenericWebappsDeployer.java:174)
 at
 org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.deploy(TomcatGenericWebappsDeployer.java:139)
 at
 org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.deployThisWebApp(AbstractWebappDeployer.java:204)
 at
 org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.deploy(AbstractWebappDeployer.java:111)
 at
 org.wso2.carbon.webapp.deployer.WebappDeployer.deploy(WebappDeployer.java:42)
 at
 org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
 at
 org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
 at
 org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
 at
 org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
 at
 org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
 at
 org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:135)
 at
 org.wso2.carbon.core.CarbonAxisConfigurator.deployServices(CarbonAxisConfigurator.java:567)
 at
 org.wso2.carbon.core.internal.DeploymentServerStartupObserver.completingServerStartup(DeploymentServerStartupObserver.java:51)
 at
 org.wso2.carbon.core.internal.CarbonCoreServiceComponent.notifyBefore(CarbonCoreServiceComponent.java:235)
 at
 org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.completeInitialization(StartupFinalizerServiceComponent.java:185)
 at
 org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.serviceChanged(StartupFinalizerServiceComponent.java:288)
 at
 org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
 at
 org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
 at
 org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
 at
 org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
 at
 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
 at
 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
 at
 

Re: WebappLoader vs WebappClassLoader

2015-04-20 Thread Thusitha Thilina Dayaratne
Hi,

 Could someone tell me what is the purpose of having WebappLoader and
 WebappClassLoader in Tomcat?
WebappLoader is the Tomcat object that a user can configure that
represents the class loader. It remains the same across web application
stop/start.

WebappClassLoader is the actual class loader. Every time the web
application is started, a new instance is created and used.

 As I understand WebappClassLoader is per web application and WebAppLoader
for
 tomcat server instance. Am I wrong?
Yes.
Thanks for the quick explanation.
So it means WebappClassLoader and WebAppLoader both are per web
application.
In tomcat 7 we were able to add repository to the class loader using
WebAppClassLoader.addRepository()
So in Tomcat 8 if we wanna add repositories to the classloader we should
done that trough the WebAppLoader not with WebAppClassLoader?
Please correct me if I'm wrong.

Thanks
Best Regards

2015-04-21 1:51 GMT+05:30 Mark Thomas ma...@apache.org:

 On 20/04/2015 14:22, Thusitha Thilina Dayaratne wrote:
  Hi,
 
  Could someone tell me what is the purpose of having WebappLoader and
  WebappClassLoader in Tomcat?

 WebappLoader is the Tomcat object that a user can configure that
 represents the class loader. It remains the same across web application
 stop/start.

 WebappClassLoader is the actual class loader. Every time the web
 application is started, a new instance is created and used.

  As I understand WebappClassLoader is per web application and
 WebAppLoader for
  tomcat server instance. Am I wrong?

 Yes.

 Mark


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




--


Re: WebappLoader vs WebappClassLoader

2015-04-20 Thread Mark Thomas
On 20/04/2015 14:22, Thusitha Thilina Dayaratne wrote:
 Hi,
 
 Could someone tell me what is the purpose of having WebappLoader and
 WebappClassLoader in Tomcat?

WebappLoader is the Tomcat object that a user can configure that
represents the class loader. It remains the same across web application
stop/start.

WebappClassLoader is the actual class loader. Every time the web
application is started, a new instance is created and used.

 As I understand WebappClassLoader is per web application and WebAppLoader for
 tomcat server instance. Am I wrong?

Yes.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org