Thursday, November 28, 2013

linux debian - logging as another user throws "Module is unknown"



>Environment
Debian 7 - amd64.



>Problem:
Attempt to login as another user throws the following error message:
  Module is unknown


 >Solution
 


Three possibilities:
- pam configuration
- pam module not installed
- pam module corrupted

Try to fix the most simple first: pam configuration, then follow the order suggested.





1. PAM CONFIGURATION:

- As root, edit the file:
su
scite /etc/pam.d/login &

- Comment the following line
session    required   pam_limits.so
- becomes:
#session    required   pam_limits.so

If you have a local oracle instance, for testing purpose and security is not a issue, comment also the lines below if you have oracle's concerned issues:


#oracle 11g install from rin201
session required /lib/security/pam_limits.so       
session required pam_limits.so

- becoming:
#oracle 11g install from rin201
#session required /lib/security/pam_limits.so       
#session required pam_limits.so

- Try again to log as another user, for instance:

  sudo login postgres

- If it fails, check pam installation.



2. INSTALLING PAM MODULES

NOTE: if you're not sure if pam is installed, you can install it.
There is no problem since if it is already installed, the apt-get will return a message telling you so.


- check the package name
dpkg --search pam

- install the following:
apt-get install libpam-modules
apt-get install libpam-runtime


3. TO REINSTALL PAM




aptitude reinstall libpam-modules



SEE ALSO:
http://www.linuxquestions.org/questions/linux-general-1/failing-at-chroot-101-a-758547/#post3705048

Sunday, November 10, 2013

struts maven project fails to start with eclipse's embedded tomcat server


Scenario:

Using eclipse's embedded tomcat server to deploy a struts project:




Result: it fails to start.



Solution

Supposing that server's configuration is correct(addres, port, etc), check the war plugin configuration in the pom.xml file.


The current value:

<plugin>
  <artifactId>maven-war-plugin</artifactId>
  <version>2.3</version>
  <configuration>
    <warSourceDirectory>WebContent</warSourceDirectory>
    <failOnMissingWebXml>false</failOnMissingWebXml>
  </configuration>
</plugin>

During a copy/paste from another project, the proper value was not set.

Switch to :

<plugin>
  <artifactId>maven-war-plugin</artifactId>
  <version>2.3</version>
  <configuration>
    <warSourceDirectory>src/main/webapp</warSourceDirectory>
    <failOnMissingWebXml>false</failOnMissingWebXml>
  </configuration>
</plugin>



 



Result : problem fixed.





Monday, November 4, 2013

Maven jar plugin missing resource




>Problem

Eclipse points parsing error on "<packaging>jar</packaging>" tag.

The error message:

Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed:
    A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.5:resources:
    org/codehaus/plexus/util/io/FileInputStreamFacade







>Solution

1. Update the libraries used by the jar plugin and add common-io jar.

- Before:

        <dependency>
            <!--used by jar plugin -->
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.1</version>
        </dependency>

        <dependency>
            <!--used by jar plugin -->
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>1.1</version>
        </dependency>




- After:

        <dependency>
            <!--used by jar plugin -->
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
      
        <dependency>
            <!--used by jar plugin -->
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>3.0.15</version>
        </dependency>

        <dependency>
            <!--used by jar plugin -->
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>


2. Finally, update the project, run:

mvn install
                      





eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...