Foren

ClassNotFoundException:com.inkwell.internet.portlets...ProductModelImpl

Kurt Xu, geändert vor 11 Jahren.

ClassNotFoundException:com.inkwell.internet.portlets...ProductModelImpl

Junior Member Beiträge: 57 Beitrittsdatum: 02.02.13 Neueste Beiträge
Hello all:
I'm so new to liferay, I'm studying liferay 6.1 by learning Liferay In Action, after I import sample portlet 'product-registration' and run command 'ant build-service' with out any issues I start liferay portal and saw below errors during deploying the new portlet:

15:30:56,306 ERROR [pool-2-thread-1][HotDeployImpl:191] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering plugins for product-registration-portlet
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering plugins for product-registration-portlet
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:46)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.invokeDeploy(PluginPackageHotDeployListener.java:62)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:188)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:151)
at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:141)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:48)
at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:858)
at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:366)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.liferay.portal.kernel.exception.SystemException: java.lang.ClassNotFoundException: com.inkwell.internet.portlets.prodreg.sb.model.impl.ProductModelImpl
at com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl.initServiceComponent(ServiceComponentLocalServiceImpl.java:172)
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 com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.security.pacl.PACLAdvice.invoke(PACLAdvice.java:51)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at $Proxy90.initServiceComponent(Unknown Source)
at com.liferay.portal.service.ServiceComponentLocalServiceUtil.initServiceComponent(ServiceComponentLocalServiceUtil.java:284)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.initServiceComponent(PluginPackageHotDeployListener.java:233)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.doInvokeDeploy(PluginPackageHotDeployListener.java:123)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.invokeDeploy(PluginPackageHotDeployListener.java:59)
... 27 more
Caused by: java.lang.ClassNotFoundException: com.inkwell.internet.portlets.prodreg.sb.model.impl.ProductModelImpl
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl.upgradeModels(ServiceComponentLocalServiceImpl.java:392)
at com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl.doUpgradeDB(ServiceComponentLocalServiceImpl.java:292)
at com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl.upgradeDB(ServiceComponentLocalServiceImpl.java:199)
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 com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.security.pacl.PACLAdvice.invoke(PACLAdvice.java:51)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at $Proxy90.upgradeDB(Unknown Source)
at com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl.initServiceComponent(ServiceComponentLocalServiceImpl.java:163)
... 50 more
2013-2-2 15:30:56 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext

I searched ProductModelImpl in the whole project, nowhere the class is used.
I have no idea what cause these errors. any ideas ? thank you, god bless you!
You can find the original sample code in the attachment downloaded from manning website.
David Ilechukwu, geändert vor 11 Jahren.

RE: ClassNotFoundException:com.inkwell.internet.portlets...ProductModelImpl

Regular Member Beiträge: 154 Beitrittsdatum: 07.06.10 Neueste Beiträge
Hi Kurt - it's kind of strange you should be getting those errors. Could you try the following (in that order)?
(1) Stop your appserver. Delete your war folder from Liferay/tomcat/webapps. Also delete tomcat/temp and tomcat/work
(2) run ant clean, then look for any code under the folders "model" and "service" - and delete them
(3) Run ant build-service again, thereafter run ant deploy
(4)If everything compiles - start your appserver up and try again.

Please let me know if this solves the problem.

Cheers
Kurt Xu, geändert vor 11 Jahren.

RE: ClassNotFoundException:com.inkwell.internet.portlets...ProductModelImpl

Junior Member Beiträge: 57 Beitrittsdatum: 02.02.13 Neueste Beiträge
Hello David: I did what you told but met the same errors unfortunately. And when I run ant deploy some compilation errors happened a few times, such as PRRegistrationLocalServiceUtil.getAllRegistrations(long) missing, I found product-registration-portlet\docroot\WEB-INF\service\com\inkwell\internet\productregistration\service\PRRegistrationLocalServiceUtil.java was missing that method which does exist in the downloaded sample code. So strange! But more strange thing is it is successful when I rerun ant deploy, but that method is still missing, when I start tomcat I see the same errors again. emoticon

You can see the erros from attached file. There is also portlet source I compiled. thanks
Kurt Xu, geändert vor 11 Jahren.

RE: ClassNotFoundException:com.inkwell.internet.portlets...ProductModelImpl

Junior Member Beiträge: 57 Beitrittsdatum: 02.02.13 Neueste Beiträge
UP
David Ilechukwu, geändert vor 11 Jahren.

RE: ClassNotFoundException:com.inkwell.internet.portlets...ProductModelImpl

Regular Member Beiträge: 154 Beitrittsdatum: 07.06.10 Neueste Beiträge
Hi Kurt -
Have you been able to sort out the issues you were having?
Kurt Xu, geändert vor 11 Jahren.

RE: ClassNotFoundException:com.inkwell.internet.portlets...ProductModelImpl

Junior Member Beiträge: 57 Beitrittsdatum: 02.02.13 Neueste Beiträge
David Ilechukwu:
Hi Kurt -
Have you been able to sort out the issues you were having?


Hello David:
It turns out that the code only works under liferay 6.0.6, a incompatible issue. I have to say liferay is not good on the compatiblity aspect. You have to be very careful with the version to which the portlet is deployed.
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: ClassNotFoundException:com.inkwell.internet.portlets...ProductModelImpl

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
Projects are not portable, although code mostly is. You have to use the sdk for the target runtime.
thumbnail
Hitoshi Ozawa, geändert vor 11 Jahren.

RE: ClassNotFoundException:com.inkwell.internet.portlets...ProductModelImpl

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
It turns out that the code only works under liferay 6.0.6, a incompatible issue


Yes, we've been complaining about the version incompatibility problem for so long. You'll have to manually fix them but you'll have to remember some api's have changed.

"Liferay in Action" is written for 6.0.6 so you should be using Liferay 6.0.6.

Liferay now has an online documentation which is written for 6.1.0 and to use Liferay IDE instead of "ant" command. Should just skim through the book and go and practice using the online documentation.
thumbnail
David H Nebinger, geändert vor 11 Jahren.

RE: ClassNotFoundException:com.inkwell.internet.portlets...ProductModelImpl

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
Kurt Xu:
Caused by: java.lang.ClassNotFoundException: com.inkwell.internet.portlets.prodreg.sb.model.impl.ProductModelImpl


I have no idea what you did, but the attached zip doesn't match this in any way, shape, or form. This package is not referenced anywhere in the code that I can see.