Creating liferay 7 plugin project - liferay

I am trying to create an liferay 7 plugin project using Ant and I am always recieving the below error, can someone help ?
it seems that the server mirrors.lax.liferay.com is down
[Console output redirected to file:/Users/yjradeh/foo/java/workspace/.metadata/.plugins/com.liferay.ide.sdk.core/sdk.log]
Buildfile: /Users/yjradeh/foo/java/liferay-plugins-sdk-7.0/portlets/build.xml
[get] Getting: http://mirrors.lax.liferay.com/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] To: /Users/yjradeh/.liferay/mirrors/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] Error getting http://mirrors.lax.liferay.com/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar to /Users/yjradeh/.liferay/mirrors/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] Getting: http://cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
[get] To: /Users/yjradeh/.liferay/mirrors/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
BUILD FAILED
/Users/yjradeh/foo/java/liferay-plugins-sdk-7.0/portlets/build.xml:5: The following error occurred while executing this line:
/Users/yjradeh/foo/java/liferay-plugins-sdk-7.0/build-common-plugins.xml:5: The following error occurred while executing this line:
/Users/yjradeh/foo/java/liferay-plugins-sdk-7.0/build-common.xml:57: The following error occurred while executing this line:
/Users/yjradeh/foo/java/liferay-plugins-sdk-7.0/build-common-ivy.xml:130: The following error occurred while executing this line:
/Users/yjradeh/foo/java/liferay-plugins-sdk-7.0/build-common-ivy.xml:81: HTTP Authorization failure
Total time: 1 second

I had the same issue while trying to compile the SDK, you can try this url: https://repository.liferay.com/nexus/content/repositories/liferay-public-snapshots/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/. Instead of the old one.
They apparently change the repository of Liferay, you can check it on Date Modification on :https://repository.liferay.com/nexus/content/repositories/.

Steps/Prerequisite for liferay on windows:
Firstly we need liferay IDE, which we can download from https://web.liferay.com/downloads/liferay-projects/liferay-ide , If you dont have eclipse editor select eclipse neon 2+liferay IDE. Or if you are having eclipse go for update archive file.
Second we need liferay plugin sdk here’s the link: https://www.liferay.com/downloads , under liferay portal CE(Community Edition) select plugins sdk.
Third, you need to download apache ant.
Download tomcat bundle from link provided in 2nd point.
Setup ANT_HOME, ANT_OPTS, CATLINA_HOME,JAVA_HOME,and JRE_HOME, and append their path accordingly in the Path field.
Let’s configure the sdk file before moving next. Keep the bundled tomcat and sdk extracted files at same folder location(mandatory). That is keep same extraction folder for tomcat and sdk plugins.
In plugins folder which you would extract, you’ll find build.properties. Replicate that file with build.username.properties. For example in my case it would be build.Jennis.properties, Keep in mind the case of the Username of your PC/laptop. And add the following line of code at the end of the file
app.server.dir=path_to_sdk../bundles/path_to_tomcat in
build.username.porperties. In my case the appended line would be
app.server.dir=C:\Users\Jennis\Documents\Downloads\com.liferay.portal.plugins.sdk-7.0/../bundles/tomcat-8.0.32
Create a bundles folder and keep the extracted folder other than SDK plugins in bundles folder.
Now we are ready to go with directly eclipse for liferay 7.0.2 installation in eclipse. Open Eclipse →Help →Install New Software. Locate the liferay IDE archive from browse button.
Now we need to add the server for liferay, to do so right click in servers window in eclipse and click on new select liferay →liferay7.x configure it and give path to tomcat8.0.32 bundle.
Run the server it will lead you to localhost:8080, configure it with defaults(not mandatory) for our example defaults are fine.
After eclipse installs the new software, it would restart in toolbar menu find the below icon and click new liferay plugin project!
If toolbar doesn't show than find it from Window →Appearance → Show Toolbar. Now click above icon and click new liferay plugin project!
Give your portlet a name.
Select build type as: Ant(liferay-plugins-sdk).
Select liferay MVC for sake of simplicity.
Next you will be prompted with SDK location give the location of SDK plugin extracted folder, which were kept at same folder at time of extracting it.
Project would be created and celebrate the first portlet.

I have also ran into this problem. The solution was in my case to change the ivy settings in build.properties (in plugins SDK root directory) like this:
ivy.version=2.4.0
ivy.jar.url=http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar
I'm however not familiar with changes Liferay made in the PATCHET version of ivy, so it could possibly lead to some other problem. But it works for portlets apparently.

Related

Writing first Liferay application: how to deploy module to server + error: A full JDK (not just JRE) is required

I'm following Liferay getting-started example to develop my first we app with Liferay IDE in which it is mentioned:
Even though all you’ve done is generate it, the guestbook-web project is ready to be built and deployed to Liferay DXP. Make sure that your server is running, and if it isn’t, select it in Developer Studio’s Servers pane and click the start button. After it starts, drag and drop the guestbook-web project from the Project Explorer to the server.
I started the server, however, I don't know how to deploy guestbook-web module to server. Drag and drop is not working for me:
When Opening the web page, this is shown which doesn't contain anything related to guestbook-web module:
Update
When I drag and drop my module on server, for some reason it is not allowed:
Update
Also, I'm receiving such errors on console:
22-Apr-2020 16:02:54.419 SEVERE [http-nio-8080-exec-6] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [Module Framework Servlet] in context with path [] threw exception [PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required] with root cause
org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
I have set both JDK and JRE path for IDE, not sure why it says A full JDK (not just JRE) is required.
Update
To fix A full JDK (not just JRE) is required error, inspired by this answer, I ran the IDE with this command:
C:\Program Files (x86)\LiferayWorkspacewithDevStudioCommunityEdition\liferay-developer-studio>DeveloperStudio.exe -vm "C:\Program Files\Java\jdk1.8.0_251\bin\javaw.exe"
The error is resolved and default widgets are fine now:
In the IDE: You'll drag the "guestbook-web" with the mouse and drop it right on the highlighted "Liferay 7.x at localhost" Server (Note: on, not below).
Outside of the IDE: Your project generates a jar, and you can copy that to Liferay's deploy directory.
Once the module is deployed, it won't magically show up on the page: Log in as Administrator, choose the "Add" button (a plus sign) and add a "widget" to the page: In the list of Widgets you'll find your new portlet/widget.
The screenshot of your installation looks weird though, as if something didn't go wrong and you'll likely need to look for signs of problems in the log file to see why Liferay ends up in the state that it's in, with a couple of default widgets being unavailable - however, that's unrelated to the question how to deploy new code to the runtime.
Edit: You've mentioned the required JDK from the log. That's good to be fixed.
With regards to the not-working drag&drop: It looks like you're using Liferay Workspace. From the icons in Project Explorer, it looks like your module isn't recognized as such: Try to "Gradle/Refresh Gradle Project" (right-click on "modules") to see if it needs some updates that are missing (and observe its log output). Icons on my IDE look like this:
Once you get those modules recognized, you should be able to drag&drop them to the server.
I realized to avoid A full JDK (not just JRE) is required error, it is needed to setup server correctly while creating it with GUI:

Unable to change runtime environment on server in Liferay Developer Studio

In Liferay Developer Studio, I am try to set the Runtime Environment for my local server. After selecting a runtime environment from the drop down, I then try to save the change and get the following message:
The server cannot be saved for the following reasons: [Overview] Changing runtime base directories is not supported.
Is this a change I need to do manually in a configuration file, or should I going elsewhere to change the runtime environment?
It seems to be a known issue in Liferay IDE, check the issue.
You may have a clean version of the Liferay-Tomcat bundle given along with the Liferay IDE. What I recommand you is to create a new server that refers to this runtime environnement.
If you don't have a clean version of the Liferay-Tomcat bundle you can download new one from Liferay official site.
I found a way to get the existing runtime evironment changed.
I first had to go to the server properties and select "Switch Location". This moved the server properties from "[workspace metadata] to my workspace/servers/ directory.
Inside the .server file, I just had to change the runtime-id property to one of my predefined runtimes, in my case...
runtime-id="Liferay v6.2 EE (Tomcat 7)"
My Liferay server is now working as expected.

csproj* Cannot save web project

I have an web project using WebAPI 2 with is compile clean and starts with owin.
So everything seam to be ok, but if i open the project properties their is always a star next to my project settings tab.
I can save it, (File => SaveAll or Ctrl + s) but the star does not disappear.
The resulting problem is that this project cannot be checked in to TFS which shows me an error message that I have to save my project.
This project is migrated from vss but the modification problem occured also before the migration
I fiugred it out:
The problem was, that in .csproj the ProjectTypeGuids tag was surrended with comments
.....</ProjectTypeGuids>-->
After uncomment the line the project can be saved

Getting stuck while creating a new plugin project in liferay 6.2, facing some kind of ivy setting issue

I am getting stuck while creating a new plugin project in liferay, eclipse get stuck everytime and console displaying only [ivy:resolve] message
It appears that the Ivy resolve process inside of the Liferay Plugins SDK is failing when it tries to create a new process.
Go into your Liferay Plugins SDK folder and open the ivy-settings.xml file. Notice that it points to some online repositories. It seems that your system is having trouble connecting to those remote repositories. See the log messages about the failing certificates (when its trying to connect to the https:// server of jboss repository ).
Maybe will be any special configuration required for connecting to those repositories, proxy...
Try from here

Liferay Portlet Issue

Im new with liferay have a problem with portlet deployment using the plugins sdk,
Platform:
liferay-portal-tomcat-5.5-5.1.2,
liferay-plugins-sdk-5.2.2,
windows vista.
Problem:
I have successfully created a sample portlet with ant and deployed it into the hot-deploy folder. It is automatically picked up by the server but the console messages say that the portlet has been copied successfully and never registers it.. and i cant find it in the add application drop-down menu.. pls your help will be very appreciated.
I don't know if anything important changed in these versions, but you say you're using Liferay 5.1.2 with the plugin environment 5.2.2 - try with matching versions - at least on the second digit.
also, make sure that all required files are available - among them are WEB-INF/web.xml, WEB-INF/portlet.xml.
Create a new sample portlet with "create.bat" in the plugin SDK's portlet folder and deploy this - it should succeed. Then make sure that all config files from the new one are present in your current one.
How did you create your current portlet? What did you do/change?

Resources