Could not execute build using Gradle upon Creation of Liferay Module Project - java

I was trying to do the liferay sample project in this link but I encountered a problem in doing it. It prompts the error message below.
I tried the solution I found in this link but still encounters the problem.
Thank you.

It looks like a network issue to me. Are you perhaps behind a proxy?
In that case you should include the settings for your proxied connection in your gradle.properties file:
systemProp.http.proxyHost=YOUR_PROXY_HOST
systemProp.http.proxyPort=YOUR_PROXY_PORT
systemProp.https.proxyHost=YOUR_PROXY_HOST
systemProp.https.proxyPort=YOUR_PROXY_PORT
Hope that helps

Related

Java - GeoLite2 database corruption when creating .jar in Gradle

Recently I have been using GeoLite2 City database in my application to get information on the user location using their IP. The database works fine in my local machine, but when I compile it to a .jar using ./gradlew -Pprod clean bootJar I get this error when trying to access a component that uses the database:
InvalidDatabaseException
Could not find a MaxMind DB metadata marker in this file (<InputStream>). Is this a valid MaxMind DB file?
Searching for this error, I found this thread on StackOveflow that explained the need to disable resource filtering for binary files in Maven. Thing is, I'm using gradle, which as far as I know, does not have this resource and should not be facing this problem.
Regardless, I tried searching for a solution and tried implementing something based on this thread to fix the issue. I ended up adding this to my build.gradle:
processResources {
from('src/main/resources/data') {
include '**/*.mmdb'
}
}
That, however, also did not work. It seems like this should be a simple issue, but I have not been able to solve it and neither did I find someone with the same issue so far. Any help would be appreaciated!
You could try this (note: I did not test it)
processResources {
filesNotMatching("**/*.mmdb") {
}
}

error occurred "java: cannot access java.util.function.Function class file for java.util.function.Function not found " in selenium

I am having the above issue once am running the code. I have changed my language level into 8 and added maven properties into the POM file. But still having this issue. Please help me to resolve this.
Yes as like above comment it's quite difficult to solve problem without any error log or code so if possible please add it.
Else where as per my experience i thought that it's occurred in case where your JDK dependency not bind properly with your project.
In such case you're not able to use that library inside your project. For that go inside "Project settings" inside your IDE and check dependency bind properly(like following image) or not if not then do it first.

Import EMX into Eclipse via command line

I hope my question will be clear enough as I am not used to Eclipse environment.
My goal is to create a project in Eclipse with an already existing EMX file. I gather that file from a Git repository.
And I would like to create a command line (or a script, or anything I can run automatically from remote) that imports that EMX file into Eclipse, so I can use another script (already created) to work with this EMX.
My problem is that I don't know how to create this script or command line.
I've tried solutions found here at StackOverflow, without success. Maybe I'm just bad :p
As I am beginner in Eclipse stuff, if someone has a link to a clear tutorial or working example, it would be very nice.
Note: I just have the EMX file (no .project or whatever). So I guess I need to create a project with this file, and not just import an existing project.
Thank you very much for your help :)
Laurent
I finally managed to do what I wanted by creating a plugin which imports projects from a given path into my current workspace.
Main part of the code is from: http://code.google.com/p/headlesseclipse/source/browse/branches/JUnit/com.ind.eclipse.headlesseclipse/src/com/ind/eclipse/headlessworkspace/HeadlessProjectImport.java?r=88
I did not find any way to do this outside the plugin. Grovvy solution was giving plenty of errors and without CDT, the first simple solution I looked for was not available.

org.apache.xerces.jaxp.SAXParserFactoryImpl not found when importing Gears API in GWT

I've created a GWT project using Eclipse which was working perfectly (I was able to run it in both Hosted Mode and on Google App Engine) until I tried to import the Gears API for Google Web Toolkit. After adding the following line to my java source file:
import com.google.gwt.gears.client.geolocation.Geolocation;
I get the following error when I try to compile:
19-Jun-2009 3:36:09 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed com.google.apphosting.utils.jetty.DevAppEngineWebAppContext#1c7d682{/,C:\Documents and Settings\Geoff Denning\workspace\TaskPath\war}
javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
I've already added the gwt-gears.jar file to my \war\WEB-INF\lib directory, and I've referenced it in Eclipse as follows:
I've even opened the gwt-gears.jar file and confirmed that org/apache/xerces/jaxp/SAXParserFactoryImpl.class does exist. Can anyone give me any pointers as to why I'm getting the above error?
Check that Xerces exists in:
$JAVA_HOME/lib/endorsed
Sounds like a Java 5 issue. Also check the Java system property for:
javax.xml.parsers.SAXParserFactory
It should be:
org.apache.xerces.jaxp.SAXParserFactoryImpl
If not then that's your issue, make sure you set the system property.
Apparently this is a bug in jre 1.5. I was able to resolve the problem by switching my default JRE in Eclipse from 1.5.0_06 to 1.6.0_03, as shown below:
Thanks to Jon and Rahul for pointing me in the right direction.
This happened to me. I had conflicting JARs in my workspace. I removed one and boom it worked. The message didn't lend very well to the root of the error.
My SAXParserFactoryImpl problem was caused by gwt-gadgets.jar I had in my boot class path. Removing this JAR from the boot class path solved the problem for me. Basically you have to remove any JAR containing a SAXParserFactoryImpl class from your build path (user libs).
Remove the $JAVA_HOME/jre/lib/jaxp.properties fixed the issue.
Take a look at Trouble with Selenium (XercesImpl) and Google App Engine.
I had a similar problem with GWT / GAE (SAXParserFactoyImpl not found) and solved it by;
Importing the jar to war/WEB-INF/lib
Adding the jar to the build path

Error : "javax.servlet.ServletException: Failed to load test suite [SampleTest], Reason is [Class not found "SampleTest"] "

Hi i am new to cactus and when i am using tomcat5.1 and have included all the necessary jars. But when i am trying to execute it, it is showing the error,
Error : "javax.servlet.ServletException: Failed to load test suite [SampleTest], Reason is [Class not found "SampleTest"] "
Please let me know what the problem is??
If you are trying to run the Quick Start tutorial from the Cactus web site, I believe it no longer works.
Here's a mention in the release notes of 1.8.1.
Release Notes - Cactus - Version 1.8.1
Bug
* [CACTUS-124] - Cannot run the Servlet Example
I get the same error message with version 1.7.x.
I just started researching this product, so I'll post an answer if I find one. Hopefully someone else will have an answer with the extra info I have provided.
EDIT:
Found a work around. Looks like it's an issue with package names. I re-compiled the two files using the default/no package and it worked.
EDIT 2:
I looked up CACTUS-124 in the bug database and it's not related. Also I believe only the class files that extend ServletTestCase need to be changed to the default/no package name.
You need to include the package ie:
http://localhost:8080/myapp/ServletTestRunner?suite=common.TestEverything
Would run the suite TestEverything in the common package.

Categories