Message Boards

com.sun.proxy.$Proxy780 cannot be cast to serviceutil

srini vasulu, modified 3 Years ago.

com.sun.proxy.$Proxy780 cannot be cast to serviceutil

Regular Member Posts: 139 Join Date: 2/22/11 Recent Posts

Hi ,
I am facing issue when i am calling the service class getting the below error. if i will call below code in module then it's working but when calling in war file portlet then getting issue.

i am calling this in liferay mvc war file portlet. i am using liferay 7.2.1
 
com.sun.proxy.$Proxy780 cannot be cast to com.test.employee.service.EmployeeDataLocalServiceUtil

my code looks likebelow
List<EmployeeData> submitalsList = EmployeeDataLocalServiceUtil.getSiteEmployees(td.getScopeGroupId()); -- this method created in impl class.

ingradel
compile project(":modules:EmployeeData-services:EmployeeData-services-api")

Please let me know what is the mistake

thumbnail
Christoph Rabel, modified 3 Years ago.

RE: com.sun.proxy.$Proxy780 cannot be cast to serviceutil

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts

My best guess is that you have two versions of your module deployed, maybe with different version numbers.

1) Check osgi/modules and osgi/war folder

Delete all your packages from there

2) Stop sever, delete the osgi/state folder

3) Startup and redeploy all your packages

hth

 

srini vasulu, modified 3 Years ago.

RE: RE: com.sun.proxy.$Proxy780 cannot be cast to serviceutil

Regular Member Posts: 139 Join Date: 2/22/11 Recent Posts

Hi Christoph,

I tried all above scenario's but no use.

my build.gradel file looks like below.

buildscript {
    dependencies {
        classpath group: "com.liferay", name: "com.liferay.css.builder", version: "3.0.2"
        classpath group: "com.liferay", name: "com.liferay.gradle.plugins.css.builder", version: "3.0.3"
    }

    repositories {
        maven {
            url "https://repository-cdn.liferay.com/nexus/content/groups/public"
        }
    }
}

apply plugin: "com.liferay.css.builder"

dependencies {
    compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
    compileOnly group: "javax.portlet", name: "portlet-api"
    compileOnly group: "javax.servlet", name: "javax.servlet-api"

    cssBuilder group: "com.liferay", name: "com.liferay.css.builder", version: "3.0.2"

    portalCommonCSS group: "com.liferay", name: "com.liferay.frontend.css.common", version: "4.0.0"
    
    compile group: "org.springframework", name: "spring-aop", version: "4.2.5.RELEASE"
    compile group: "org.springframework", name: "spring-beans", version: "4.2.5.RELEASE"
    compile group: "org.springframework", name: "spring-context", version: "4.2.5.RELEASE"
    compile group: "org.springframework", name: "spring-core", version: "4.2.5.RELEASE"
    compile group: "org.springframework", name: "spring-expression", version: "4.2.5.RELEASE"
    compile group: "org.springframework", name: "spring-web", version: "4.2.5.RELEASE"
    compile group: "org.springframework", name: "spring-webmvc", version: "4.2.5.RELEASE"
    compile group: "org.springframework", name: "spring-webmvc-portlet", version: "4.2.5.RELEASE"
   compile project(":modules:EmployeeService:EmployeeService-api")
    compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}

war {
    dependsOn buildCSS
    exclude "**/*.scss"

    filesMatching("**/.sass-cache/") {
        it.path = it.path.replace(".sass-cache/", "")
    }

    includeEmptyDirs = false
}
 

.here modules:EmployeeService:EmployeeService-api is my service classes.