I encountered problem in Liferay. I want to create new service exactly the same service like the one that presented in the Liferay's developer documentation. However, after copy-pasting the XML to the portlet folder I try to build t using the command on my command prompt:
ant build-service
I get nothing. It only say on the console like this:
Buildfile: D:\Program\liferay-plugins-sdk-6.1.1\portlets\NewPortlet-portlet\build.xml
build-service:
It stayed like that for so damn long, and still. I don't know what's the problem, is it because the Ant? I use the latest version of apache ant(currently: Apache Ant(TM) version 1.8.4 compiled on May 22 2012)
Is it because of configuration in the build.xml in the portlet folder?
Anybody encountered the same problem? or is it just me?
Ant hanging during a build task is typically because there is a cluster config enabled in a properties file.
Remove/comment out the cluster configurations and that should clear the problem.
Related
I'm trying to deploy a Liferay rest-builder project. These are the steps I follow to do it:
I create a rest-builder project with Liferay Developer Studio wizard.
I edit the *-impl/rest-openapi.yaml file
I launch the buildREST Gradle task
BuildREST task ends successfully
I launch the deploy Gradle task
Deploy task ends successfully
When JAR tries to deploy, it lets this message in log:
Unable to start bundle: file:/C:/devs/testlr73/bundles/osgi/modules/com.liferay.training.service.rest.impl.jar
org.osgi.framework.BundleException: Could not resolve module: com.liferay.training.service.rest.impl [1368]_ Unresolved requirement: Import-Package: com.liferay.portal.vulcan.pagination; version="[1.4.0,2.0.0)"
I tried this operation with versions 7.1, 7.2, 7.3 and 7.4.
Only 7.4 deploys without a problem (after fix the version in the javax.xml.bind dependency).
I was trying found where is set the Import-Package to fix it but I can't found it.
There are two general approaches to fix your problem.
Initialize a new project based on your exact version of Liferay (and copy your code into the created projects)
Try to fix all dependencies manually
I would suggest to go with 1. as this seems the "cleaner" approach to me. But I will try to explain both ways here as much in detail as I can.
FIRST APPROACH: Initialize a new project
When creating a project with blade, you can give it 2 additional / optional parameters:
--product (dxp | portal - for the community version)
-v (version - like 7.2, 7.3,...)
The whole command for a DXP 7.3 would look like this:
blade create --product dxp -v 7.3 -t rest-builder automapper-service
As for the wizard in Dev Studio, you should be able to select the Liferay Version and the Flavor as well for your project - if you use a Liferay Workspace usually you select it once for the workspace.
DevStudio writes this information in your gradle.build of the workspace, so you can change it afterwards, its the liferay.workspace.product and liferay.workspace.target.platform.version variables.
Please have a look here for an exact walkthrough for creating a project in dev studio.
SECOND APPROACH: Manually updating the dependencies
Your package needs the Vulcan API as dependency. And as the deployment in 7.4 works, you seem to compile it for the 7.4 version.
So I would do following approach:
1 Check which version of Vulcan API Liferay is running in your desired Liferay
Startup a Liferay server.
Goto its Gogo Shell and execute:
lb vulcan
You should get some entries back, the correct one is the "Liferay Portal Vulcan API", in my case (DXP 7.3 SP3) it has the version 7.19.2
So you should remember / note that version.
2 Replace all occurences of that dependency in your gradle files
Liferay has an article here which explains more in detail on how to resolve bundle dependencies
Search in Dev Studio via Search -> File for com.liferay.portal.vulcan.api
For example in your build.gradle you will have something like this
compileOnly group: "com.liferay", name: "com.liferay.portal.vulcan.api", version: "9.3.1"
Update the version to your target version and save the file, so in my case it would look like:
compileOnly group: "com.liferay", name: "com.liferay.portal.vulcan.api", version: "7.19.2"
One note of warning for this approach: There might be further issues with other dependencies as well. You will have to resolve all of them to successfully deploy to your desired Liferay version. Good thing though, you can do it the same way I described above.
I am developing a server with Jetty (servlet container). I am successfully running the server within Eclipse with an osgi-framework run configuration. Everything fine.
What is the best way to export this run configuration so that I have a valid config.ini and all plugins (the workspace bundles and the ones from my target platform) and am able to run the osgi-framework without Eclipse IDE running.
I tried to make a product to get the config.ini and all the bundles but I cannot run the framework with java -jar org.eclipse.osgi_3.6.2.R36x_v20110210.jar.
It is not finding the bundles in the plugin folder, because obviously the names do not match exactly (e.g.: com.mine.at-3.3.-3234234.jar instead of com.mine.at.jar)
There are about 150 bundles and I do not want to edit the config.ini manually.
What did I miss?
What worked pretty well for me was to make a new product, based on the (working) run configuration, and export the product. That project should then be 'runnable', or at least pretty close.
Did you try that?
Hope it helps, Frank
I have a Java GWT-Spring-JPA project that I am developing in Eclipse with the OEPE plugin. When my server(Weblogic is running), if I compile the code, and reload my webpage without restarting the server, I get a strange error message, and I have to restart Weblogic for it work.
At one particular point in the code, I get a ClassCast exception to the effect Cannot cast class A to class A !!
Sometimes I get an error during the compile to the effect - Error compiling because jndi.properties file could not be deleted. Anyone seen this?
These errors are really slowing me down! Does anyone have any solutions please?
Any input much appreciated.
You should use development mode as you are already and do a exploded deployment from your app diring development in the default auto-deploy directory in your weblogic domain, in the link below you will find general guidance on it.
http://download.oracle.com/docs/cd/E21764_01/web.1111/e13706/toc.htm
If you are using Ant you may use the wldeploy ant task for that:
http://download.oracle.com/docs/cd/E21764_01/web.1111/e13706/splitcreate.htm#WLPRG182
Well with this environment configured you wont need to restart when you have a static or a page updated it will do it automatically and if you need to force a general classloading update you could have a REDEPLOY file in your split directory(META-INF if using .ear or WEB-INF if using .war) that whenever you do a touch(change it) on it, weblogic will restart your app context WITHOUT restarting the server, updating the class loader for your app and possibly solving your problem.
regards.
I'm trying to write a script (Perl) that will automate the adding of Tomcat server for a Java project under Eclipse.
The project is checked out via SVN, and I want, once the project is downloaded via SVN, to run a script that will automatically configure the remaining bits of the project. In this context, I need to find how can I edit which Eclipse's configuration files to automate the adding of a Tomcat server. Actually the script will also modify other configuration files, but I'm facing a hard time trying to find which files to edit and how to add Tomcat.
Any insights will be welcome, thanks in advance.
There is a plugin for eclipse called Escripts. You can create xml like scripts to automate actions like doing wizard actions. I tried to check the documentation, but the homepage of the Escripts is giving back http 500 for me (http://escripts.sf.net). I have written a mail to the author, if he answers, I will let you know. The update site looks like working (uncheck the categorize by groups to see the uncategorized plugin): http://escripts.sf.net/updates .
Some examples you can found at http://escripts.svn.sourceforge.net/viewvc/escripts/trunk/net.sf.escripts.tests/src/net/sf/escripts/tests/
What you should enter in the script is a wizard with id org.eclipse.wst.server.ui.new.server. The plugin, that is containing it is org.eclipse.wst.server.ui. Take a look at the plugin.xml in that plugin. Without the documentation, this is what I can remember of.
Have you tried the following files in the Eclipse workspace?
.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jdt.core.prefs
.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jdt.launching.prefs
.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.wst.server.core.prefs
.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jst.server.tomcat.core.prefs
I took the following files and dropped them into a new instance of eclipse and it created the Tomcat server under Server->Runtime Environment.
http://dl.dropbox.com/u/9591144/StackOverflow/org.eclipse.jdt.core.prefs
http://dl.dropbox.com/u/9591144/StackOverflow/org.eclipse.jdt.launching.prefs
http://dl.dropbox.com/u/9591144/StackOverflow/org.eclipse.jst.server.tomcat.core.prefs
http://dl.dropbox.com/u/9591144/StackOverflow/org.eclipse.wst.server.core.prefs
i am not able to build Web Service Client, it is showing an error msg :You are running on JDK6 which comes with JAX-WS 2.1 API, but this tool requires JAX-WS 2.2 API. Use the endorsed standards override mechanism (http://java.sun.com/javase/6/docs/technotes/guides/standards/), or set xendorsed="true" on .
BUILD FAILED (total time: 0 seconds)
can any one help me out to solve this ...
Thanks in Advance :)
Are you running on Unix? Is the wsimport in your path in the glassfish directory or the Java install directory? I seem to remember getting this and changing my path so I got the wsimport from glassfish.
I don't know main cause but i think sometimes IDE causes that. Deleting WS reference and adding ws client again works for me sometimes.
Just click on netbeans generated error link (by clicking on it, netbeans will open jaxws-build.xml & goes to wsimport tag definition line) & add attribute xendorsed="true" somewhere in "wsimport" tag.
Or you can download & add JAX-WS 2.2 API jar file in your project classpath.
Check the JDK configuration being ran by the IDE,
When using Netbeans,
Step 1:
Find the Netbeans.conf file (C:\Program
Files\NetBeans7.0\etc\netbeans.conf)
Step 2:
Change "netbeans_jdkhome" to point to the newer JDK (i.e.
netbeans_jdkhome="C:\Program Files\Java\jdk1.7.0_80")
Note: Try similar steps for other IDEs