Fórum

com.liferay.util.EncryptorException cannot be resolved to a type

Luis Alamo, modificado 7 Anos atrás.

com.liferay.util.EncryptorException cannot be resolved to a type

New Member Postagens: 19 Data de Entrada: 02/03/16 Postagens Recentes
Hello,

I'm developing a service-portlet,

I'm using the Encryptor utility to encrypt some strings. That utility requires EncryptorException class to be handle the exception.

The question is I'm properly including that class in my project and I'm getting this error:

 [echo] Loading jar:file:/C:/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
     [echo] SLF4J: Class path contains multiple SLF4J bindings.
     [echo] SLF4J: Found binding in [jar:file:/C:/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT/WEB-INF/lib/util-slf4j.jar!/org/slf4j/impl/StaticLoggerBinder.class]
     [echo] SLF4J: Found binding in [jar:file:/C:/workspace/b595365/liferay-plugins-sdk-6.2/portlets/Mercantil-Liferay-portlet/docroot/WEB-INF/lib/logback-classic.jar!/org/slf4j/impl/StaticLoggerBinder.class]
     [echo] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
     [echo] SLF4J: Actual binding is of type [com.liferay.util.sl4fj.LiferayLoggerFactory]
     [echo] Loading jar:file:/C:/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
     [echo] Loading file:/C:/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT/WEB-INF/classes/portal-ext.properties
     [echo] Loading jar:file:/C:/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
     [echo] Building Magazines
     [echo] Building News
     [echo] Building Suggestions
     [echo] Building Users
     [echo] Writing C:\workspace\b595365\liferay-plugins-sdk-6.2\portlets\Mercantil-Liferay-portlet\docroot\WEB-INF\service\com\mercantilbanco\liferay\service\UsersLocalService.java
    [javac] Compiling 9 source files to C:\workspace\b595365\liferay-plugins-sdk-6.2\portlets\Mercantil-Liferay-portlet\docroot\WEB-INF\service-classes
    [javac] ----------
    [javac] 1. ERROR in C:\workspace\b595365\liferay-plugins-sdk-6.2\portlets\Mercantil-Liferay-portlet\docroot\WEB-INF\service\com\mercantilbanco\liferay\service\UsersLocalService.java (at line 120)
    [javac] 	com.liferay.util.EncryptorException;
    [javac] 	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


And my code is this :

...
import com.liferay.util.Encryptor;
import com.liferay.util.EncryptorException;
...
public class UsersLocalServiceImpl extends UsersLocalServiceBaseImpl {
...
public JSONObject validateAnswerQuestion(String screenName, String answer) throws PortalException, SystemException, NoSuchUserException, EncryptorException {
// some logic here

}
}


I don't know why is failing, a way to clean the project or somenthing like that? this was working well and suddenly failed.

Thanks!
thumbnail
Andrew Jardine, modificado 7 Anos atrás.

RE: com.liferay.util.EncryptorException cannot be resolved to a type

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Seems like it can't find the class that you are referencing. That class is stored in the util-java.jar which is stored in the TOMCAT_HOME/webapps/ROOT/WEB-INF/lib (assuming you are on Tomcat of course). It looks like you are missing a dependency in your project.

A separate question though -- what is it you are trying to do that you need that exception? You're missing some of the good stuff in your sample

// some logic here


... what is some logic doing?
Luis Alamo, modificado 7 Anos atrás.

RE: com.liferay.util.EncryptorException cannot be resolved to a type

New Member Postagens: 19 Data de Entrada: 02/03/16 Postagens Recentes
Andrew Jardine:
Seems like it can't find the class that you are referencing. That class is stored in the util-java.jar which is stored in the TOMCAT_HOME/webapps/ROOT/WEB-INF/lib (assuming you are on Tomcat of course). It looks like you are missing a dependency in your project.

A separate question though -- what is it you are trying to do that you need that exception? You're missing some of the good stuff in your sample

// some logic here


... what is some logic doing?


Thanks!!

I had to copy the util-java.jar from the tomcat path to my project in eclipse and It is working.