Problem stuff

1. Restore a Postgres Database


Use this command

pg_restore -c -C -d poliweb -U postgres -h localhost ./poliweb.sql

where 

-c: Cleans or drops all objects of the DB before restoring then

-C: Create the database before restoring it.

-d: Name of the database to restore

-U: name of the user

-h: host

./poliweb.sql is the backup file


2. Eclipse remove a server and cannot add it again

It's a problem solved in stackoverflow

  • In Eclipse Window–>Preferences–>Server–>Runtime Environments and delete server definition from there.
  • Change directory to workspace.
  • Then under workspace folder follow this path: .metadata\.plugins\org.eclipse.core.runtime\.settings folder delete org.eclipse.jst.server.tomcat.core.prefs
  • At the same directory delete org.eclipse.wst.server.core.prefs.
  • Restart Eclipse

3. Eclipse cannot start tomcat


The following errors may be reported:

SEVERE: A child container failed during start

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JSFv02]]

Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-000072: Bean declaring a passivating scope must be passivation capable.  Bean:  Managed Bean [class org.ximodante.jsf.NumGenerator] with qualifiers [@Default @Any @Named]

And this window may appear:



SOLUTION 1: A bean has been declared without "implements Serializable", so DON'T FORGET TO IMPLEMENT SERIALIZABLE !!!!! 


SOLUTION2: You are using lombok annotations but you have not installed lombok in eclipse. See lombok web on how to install it.


4. Eclipse cannot find class javax.servlet.jsp.jstl.core.Config


It has appeared when using jsf templates as Marti Hall teaches.
The following errors may be reported:


SEVERE: Servlet.service() for servlet [FacesServlet] in context with path [/JSFv02] threw exception [javax/servlet/jsp/jstl/core/Config] with root cause

java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config

SOLUTION: Include this maven dependency in pom.xml

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>


5. Eclipse incrementing Tomcat's startup time out

It's a problem solved in stackoverflow.

Double-click your tomcat server in servers view and look for timeouts and change "start in seconds" field to the desired timeout in seconds.



6. Eclipse failing to start up with Java 9.

Once you have installed Java JDK 9, and try to run Eclipse Neon, you can get this remark:



It's a problem solved in Eclipse Wiki. This problem is solved adding this line to the eclipse.ini file


--add-modules=ALL-SYSTEM

    If you are using another JRE with version earlier than 9, this entry should be deleted

    7. Eclipse maven: A zip file cannot be read or is corrupted from repository.

    The solution may be deleting the zip file from the local repository and afterwards, right-click on project and select maven-update project. See crunchify


    8. Ubuntu picking a Java version from all of the installed


    Use the command


    sudo update-alternatives --config java
    

    and select the desired version


    $ sudo update-alternatives --config java
    There are 2 choices for the alternative java (providing /usr/bin/java).
     
      Selection    Path                                            Priority   Status
    ------------------------------------------------------------
      0            /usr/lib/jvm/java-6-openjdk/jre/bin/java         1061      auto mode
      1            /usr/lib/jvm/java-6-openjdk/jre/bin/java         1061      manual mode
    * 2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1051      manual mode
     
    Press enter to keep the current choice[*], or type selection number: 2
    

    David Salter explains this subject better.




    No hay comentarios:

    Publicar un comentario

    JEE & JSF16th Part: Creating an abstraction view layer to JSF components and Forms (5/5). Frequent problems

    1. ERROR #1: Using a bean that does not exists In the previos entry we used this facelet file: 1 2 3 4 5 6 7 8 9 10 11 1...