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:
- I created a new java project
- Added a new lib folder to my project.
- Copied the security.jar(also tried with security-ee.jar) from $glassfish-installation-folder\glassfish\modules to lib folder
- 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
security.jar
to your Java Build Path, but notsecurity-ee.jar
. Did you do that intentionally? Under the Referenced Libraries node, you can expand the JARs to see what they contain.