[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13582052#comment-13582052
 ] 

Dave Cahill commented on CLOUDSTACK-1173:
-----------------------------------------

After a long and messy debugging session, I think I see what's wrong here.

Using jdb, I traced the source of the exception to this line:

com.cloud.agent.AgentShell:498
                ServerResource resource = (ServerResource) constructor
                        .newInstance();

constructor in this case has a clazz of 
com.cloud.agent.resource.consoleproxy.ConsoleProxyResource(), and this line 
fails.

The line is trying to create an instance of 
com.cloud.agent.resource.consoleproxy.ConsoleProxyResource, however during the 
Spring refactor, this class was changed to be abstract - see commit [1]. I'm 
guessing trying to instantiate an abstract class would cause an 
InstantiationException:

diff --git 
a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java 
b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
index 48f5079..8a3a271 100644
--- a/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
+++ b/agent/src/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
@@ -77,7 +77,7 @@ import com.google.gson.Gson;
  * server.
  * 
  */
-public class ConsoleProxyResource extends ServerResourceBase implements
+public abstract class ConsoleProxyResource extends ServerResourceBase 
implements
         ServerResource {
     static final Logger s_logger = 
Logger.getLogger(ConsoleProxyResource.class);
 
So my guess is that either this abstract modifier needs ro be removed again, or 
we need to change systemvm/conf/agent.properties, which points ConsoleProxy at 
this abstract class:

root@v-2-VM:/usr/local/cloud/systemvm# tail -3 conf/agent.properties 

instance=ConsoleProxy
resource=com.cloud.agent.resource.consoleproxy.ConsoleProxyResource

The Spring commit is Kelven's, so hopefully he'll know whether the above guess 
makes sense, and which fix is better.


[1] 
https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=commitdiff;h=176523254e211abef4f0e77278be8af587d7d5ad#patch4

                
> ConsoleProxyResource instantiation exception
> --------------------------------------------
>
>                 Key: CLOUDSTACK-1173
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-1173
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: VNC Proxy
>    Affects Versions: 4.1.0
>         Environment: devcloud
>            Reporter: Marcus Sorensen
>             Fix For: 4.1.0
>
>
> Looks like ConsoleProxy software is not coming up in the latest branches:
> log4j:WARN No appenders could be found for logger 
> (org.apache.commons.httpclient.params.DefaultHttpParams).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more 
> info.
> Unable to start agent: Instantiation excetion when loading resource: 
> com.cloud.agent.resource.consoleproxy.ConsoleProxyResource due to: 
> java.lang.InstantiationException

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to