Hi all,

This is seemingly working in today's CEP pack with 4.2.0 version of the
feature.

However, when analyzing the code where the exception was thrown, the
following code was seen.

    public boolean isValidTenant(String domain) {
        int tenantId;
        if(domain == null || domain.equals("")) {
*            tenantId = CarbonContext.getCurrentContext().getTenantId();*
        }
        try {
             tenantId = LoggingUtil.getTenantIdForDomain(domain);
        } catch (LogViewerException e) {
            log.error("error while getting tennat id from tenant domain",
e);
            return false;
        }

        if(tenantId == MultitenantConstants.INVALID_TENANT_ID) {
            return false;
        }
        return true;
    }

which calls CC.getCurrentContext() method which is discouraged AFAIK.

Since we are using the managment console log viewer with CEP, I think it is
better if the CC refactored 4.2.1 feature is used. However, a dependency
issue comes up when including 4.2.1 feature as mentioned in previous mail.
So I think it is better to fix the 4.2.1 feature and use that instead of
the 4.2.0.

@IsuruP, would it be possible for you to look into this since you did the
original refactoring for logging-mgt feature?

Thanks,
Lasantha


On 21 October 2013 22:54, Lasantha Fernando <[email protected]> wrote:

> Hi all,
>
> We are getting the following error when browsing application logs/system
> logs via management console UI.
>
> [2013-10-21 22:35:29,530] ERROR - {RPCMessageReceiver}  Could not
> initialize class org.wso2.carbon.logging.util.LoggingUtil
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
>         ....
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>  at java.lang.Thread.run(Thread.java:662)
> Caused by: java.lang.NoClassDefFoundError: Could not initialize class
> org.wso2.carbon.logging.util.LoggingUtil
>  at
> org.wso2.carbon.logging.service.LogViewer.isValidTenant(LogViewer.java:109)
> ... 120 more
>
> which is reported at [1]. We are using
> org.wso2.carbon.logging.mgt.feature:4.2.0.
>
> A 4.2.1 version of the feature is also available which was created after
> CC refactoring. However, am getting the following error at p2-profile-gen
> stage when this version is included to the pack.
>
> Installation failed.
> Cannot complete the install because one or more required items could not
> be found.
>  Software being installed: WSO2 Carbon - Logging Management Feature 4.2.1
> (org.wso2.carbon.logging.mgt.feature.group 4.2.1)
>  Missing requirement: org.wso2.carbon.logging.service 4.2.1
> (org.wso2.carbon.logging.service 4.2.1) requires 'package
> org.springframework.util [3.1.0.wso2v1,3.2.0)' but it could not be found
>  Cannot satisfy dependency:
>   From: WSO2 Carbon - Logging Management Feature 4.2.1
> (org.wso2.carbon.logging.mgt.feature.group 4.2.1)
>   To: org.wso2.carbon.logging.mgt.server.feature.group [4.2.1]
>  Cannot satisfy dependency:
>   From: WSO2 Carbon - Logging Management Core Feature 4.2.1
> (org.wso2.carbon.logging.mgt.server.feature.group 4.2.1)
>   To: org.wso2.carbon.logging.service [4.2.1]
> Application failed, log file location:
> /home/lasantha/.m2/repository/org/eclipse/tycho/tycho-p2-runtime/0.13.0/eclipse/configuration/1382372488588.log
>
> Any idea why this exception is occurring? Would appreciate much if someone
> can give a pointer regarding the exception...
>
> Thanks!
> Lasantha
>
> [1] https://wso2.org/jira/browse/CEP-581
>
> --
> *Lasantha Fernando*
> Software Engineer - Data Technologies Team
> WSO2 Inc. http://wso2.com
>
> email: [email protected]
> mobile: (+94) 71 5247551
>



-- 
*Lasantha Fernando*
Software Engineer - Data Technologies Team
WSO2 Inc. http://wso2.com

email: [email protected]
mobile: (+94) 71 5247551
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to