0

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

6
  • Eclipse IDE 2019-03 is almost four years and 15 releases behind. Please upgrade. You added security.jar to your Java Build Path, but not security-ee.jar. Did you do that intentionally? Under the Referenced Libraries node, you can expand the JARs to see what they contain.
    – howlger
    Feb 8 at 13:29
  • Thank you for your anwser! I also tried adding security-ee.jar to java build path but it didn't worked! I also tried to search the class in the two mentioned JARs but I didn't find the class that I need. Feb 8 at 13:41
  • Well does that class exist in Glassfish 4? The document you reference is for Glassfish 3
    – greg-449
    Feb 8 at 14:05
  • Yes I searched in the documentation and the they are referring to this class: javaee.github.io/glassfish/doc/4.0/… Adding all the jars in a new Library solved the issue Feb 8 at 14:20
  • Does this question involve MongoDB Realm, the database, and the tag indicates? If so, what's the tie-in?
    – Jay
    Feb 8 at 22:37

1 Answer 1

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.