Fórum

Eclipse Error - Could not publish to the server.

thumbnail
Manuel Miklo, modificado 7 Anos atrás.

Eclipse Error - Could not publish to the server.

New Member Postagens: 20 Data de Entrada: 30/01/10 Postagens Recentes
Hello,
i have a problem with Eclipse Mars. At the beginning when i installed the Liferay IDE with Liferay-Portal 6.2 GA6 all things worked fine. I've done the guest-book-portlet from the Liferay webpage. And all things worked fine. The deployment too. Then i have created a new Portlet and defined the config-mode in the portlet-xml. Means that i have inserted following lines...

<init-param>
<name>view-template</name>
<value>/html/gallery/view.jsp</value>
</init-param>
<init-param>
<name>config-template</name>
<value>/html/gallery/edit.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
</supports>

then i deployed the portlet..and following error occurs in Eclipse..not in the Console..but in Eclipse..with a Eclipse-Dialog:

Could not publish to the server.
Unable to inject JSP into L/gallery-portlet/docroot/html/gallery/edit.jsp

Then i deleted the config-tags from the portlet.xml. Then the error was always there. Since then all portlets have this error. Ever when i deploy or safe a file. For all projects. Too when the server is not running. But now the error is :

Could not publish to the server.
Unable to inject JSP into L/gallery-portlet/docroot/html/gallery/view.jsp

Means that now the error occurs when i want insert only the view. And this for all portlets. Does anybody knows why this happens?

Thanks a lot for all infos where could help me.
thumbnail
Andrew Jardine, modificado 7 Anos atrás.

RE: Eclipse Error - Could not publish to the server.

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hi Manuel,

Assuming we get back to the point where you add your configuration template I think you have the init param/config mode mixed up? If you are looking for a configuration screen (the little wrench on the portlet handles > Configuration menu entry) then I think you need to have an init param as you have

<init-param>
    <name>config-template</name>
    <value>/html/gallery/edit.jsp</value>
</init-param>


But I am pretty sure that this goes with the support mode of

<supports>
    <mime-type>text/html</mime-type>
    <portlet-mode>config</portlet-mode>
</supports>


... at least that is how I have always done it.

Aside from this -- can you try two things for me?

1. Can you try deploying your portlet from the command line instead of the IDE? (if you need help with this just let us know if you are using Maven or ANT)

2. Can you start eclipse from a terminal/console window and then generate the problem scenario? This will probably dump a stacktrace in the console window that you can share with us.
thumbnail
Manuel Miklo, modificado 7 Anos atrás.

RE: Eclipse Error - Could not publish to the server.

New Member Postagens: 20 Data de Entrada: 30/01/10 Postagens Recentes
Hi Andrew
thanks for the answer.

I have done what you wrote that i should do.

First i started eclipse from the console. But there is no output from the error. This is the output:

manuel@manuel-Aspire-V3-771:~$ eclipse
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: /home/manuel/Entwicklung/Liferay_Workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.6.2.20150902-0002.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://911.fwk26046630:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://911.fwk26046630:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback

Second i deployed the portlet with Ant. This works like a charm. No problem. No error occurs. I deployed it with Ant in Eclipse. This works with no problems. The "funny" thing is, that when i select "Redeploy" on the Contextmenu in the Servers-Tab in Eclipse.. It works too. Its only when i safe a file then this error occur. And that's ever. Too when the server isn't running.
And i have deleted the config-parameter. But the next problem is, that this error occur in all portlets where i have in this workspace. Too for portlets where i have created befor this error occured. Ever when i save a file... i think that have something to do with the hot deployment from the liferay-plugin in eclipse... but i dont understand how liferay do this hot-deployment. As i wrote..redeploy works correctly. The error occurs only when i put the portlet on the server in the server-tab and when i save a file.. When i then press "Redeploy" on the portlet in the server-tab then it will works... i dont understand this.
Question:
is there somewhere a log-file where eclipse will write when a "Problem
thumbnail
Manuel Miklo, modificado 7 Anos atrás.

RE: Eclipse Error - Could not publish to the server.

New Member Postagens: 20 Data de Entrada: 30/01/10 Postagens Recentes
Ok, i found the error-log-file....
thats the stacktrace:

java.lang.RuntimeException: Unable to inject JSP into L/gallery-portlet/docroot/html/gallery/view.jsp
at com.genuitec.eclipse.webclipse.livepreview.deploy.InjectJSPIDsFlatFile.injectJSPFile(InjectJSPIDsFlatFile.java:67)
at com.genuitec.eclipse.webclipse.livepreview.deploy.InjectJSPIDsFlatFile.getAdapter(InjectJSPIDsFlatFile.java:45)
at org.eclipse.wst.web.internal.deployables.FlatComponentDeployable$ComponentModuleResource.getAdapter(FlatComponentDeployable.java:382)
at org.eclipse.wst.server.core.util.PublishHelper.copyFile(PublishHelper.java:498)
at org.eclipse.wst.server.core.util.PublishHelper.publishDelta(PublishHelper.java:435)
at org.eclipse.wst.server.core.util.PublishHelper.publishDelta(PublishHelper.java:459)
at org.eclipse.wst.server.core.util.PublishHelper.publishDelta(PublishHelper.java:459)
at com.liferay.ide.server.tomcat.core.LiferayPublishOperation.publishDir(LiferayPublishOperation.java:230)
at com.liferay.ide.server.tomcat.core.LiferayPublishOperation.execute(LiferayPublishOperation.java:115)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.performTasks(ServerBehaviourDelegate.java:1335)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:954)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3172)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
at com.genuitec.eclipse.webclipse.livepreview.common.JSPInjector.collectInstrumentationData(JSPInjector.java:139)
at com.genuitec.eclipse.webclipse.livepreview.common.JSPInjector.generateStream(JSPInjector.java:90)
at com.genuitec.eclipse.webclipse.livepreview.deploy.InjectJSPIDsFlatFile.injectJSPFile(InjectJSPIDsFlatFile.java:63)
... 14 more