eclipseglassfish-4

Glassfish 4, Eclipse IDE 2019-03 - CustomRealm: AppservPasswordLoginModule cannot be resolved to a type


I would like to implement a Custom Realm by overriding the security classes but I'm getting an error: AppservPasswordLoginModule cannot be resolved to a type The import com.sun.appserv cannot be resolved

I followed the steps from this tutorial: https://computingat40s.wordpress.com/how-to-create-a-custom-realm-in-glassfish-3-1-2-2/

What I did:

  1. I created a new java project
  2. Added a new lib folder to my project.
  3. Copied the security.jar(also tried with security-ee.jar) from $glassfish-installation-folder\glassfish\modules to lib folder
  4. I added this line to my .classpath file:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="lib" path="lib/security.jar" />
    <classpathentry kind="output" path="bin"/>
</classpath>

I also tried to add the jar to build path using Eclipse GUI NOTES: I'm not using MAVEN, I also tried to clean the project as it was mentioned in other answers

After making this steps Eclipse throws me an arror when I want to extend MyCustomModule with AppservPasswordLoginModule: enter image description here


Solution

  • UPDATE!

    I found the JAR that must be added to JAVA build path: glassfish-ee-api.jar


    I solved the problem by creating a new library where I copied all the JARS from $glassfish-installation-folder\glassfish\modules Photo