Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-49662

ClassCastExceptions if using many to many relationships with Servicebuilder

    Details

      Description

      1. Create two entities with servicebuilder
      2. Define relationsship between each other
      3. Deploy with LR IDE
      4. change one of the LocalServiceImpl
      5. Automatic (Re) deploy with LR IDE
      6. Call function get related records -> ClassCastException

      Caused by: java.lang.ClassCastException: de.bmwfs.collaboration.model.impl.AddressBookImpl cannot be cast to de.bmwfs.collaboration.model.AddressBook
      	at de.bmwfs.collaboration.service.persistence.AddressBookPersistenceImpl.fetchByPrimaryKey(AddressBookPersistenceImpl.java:1452)
      	at de.bmwfs.collaboration.service.persistence.AddressBookPersistenceImpl.findByPrimaryKey(AddressBookPersistenceImpl.java:1414)
      	at de.bmwfs.collaboration.service.persistence.AddressBookPersistenceImpl.findByPrimaryKey(AddressBookPersistenceImpl.java:1)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:320)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	at com.liferay.portal.dao.shard.advice.ShardPersistenceAdvice.invoke(ShardPersistenceAdvice.java:54)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at com.sun.proxy.$Proxy414.findByPrimaryKey(Unknown Source)
      	at com.liferay.portal.service.persistence.impl.TableMapperImpl.getBaseModels(TableMapperImpl.java:400)
      	at com.liferay.portal.service.persistence.impl.TableMapperImpl.getRightBaseModels(TableMapperImpl.java:265)
      	at de.bmwfs.collaboration.service.persistence.VotingPersistenceImpl.getAddressBooks(VotingPersistenceImpl.java:2765)
      	at de.bmwfs.collaboration.service.persistence.VotingPersistenceImpl.getAddressBooks(VotingPersistenceImpl.java:2744)
      	at de.bmwfs.collaboration.service.persistence.VotingPersistenceImpl.getAddressBooks(VotingPersistenceImpl.java:2725)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:320)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      	at com.liferay.portal.dao.shard.advice.ShardPersistenceAdvice.invoke(ShardPersistenceAdvice.java:54)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      	at com.sun.proxy.$Proxy841.getAddressBooks(Unknown Source)
      	at de.bmwfs.collaboration.service.impl.VotingLocalServiceImpl.getVotingAddressBooks(VotingLocalServiceImpl.java:229)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
      	at com.sun.proxy.$Proxy929.getVotingAddressBooks(Unknown Source)
      	at de.bmwfs.collaboration.service.VotingLocalServiceUtil.getVotingAddressBooks(VotingLocalServiceUtil.java:649)
      	at org.apache.jsp.html.portlet.start_002dvoting.view_002dparticipants_jsp._jspService(view_002dparticipants_jsp.java:410)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
      	... 146 more
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 30 weeks, 3 days ago

                  Packages

                  Version Package