Code Monkey home page Code Monkey logo

Comments (10)

mmoayyed avatar mmoayyed commented on July 25, 2024 2

With this approach I can implement in a way that if the file is being used (lock files for example) don't try to delete it. What do you think?

No, that's a very very bad idea.

There is an inordinate amount of literature on the CAS docs asking you to stop writing code. What you're describing sounds like an issue with the project; not something you need to fix for you on your own. There is no such thing as the people from CAS. YOU are the people from CAS. YOU are part of the project as you soon as you start deploying the software. The responsibility is shared; not passed off to a bunch of other folks to fix issues for you. Work on the issue, provide a pull request/patch and solve the problem where it belongs once. Or, you'd be setting yourself up for a lot of surprises and disappointments.

from cas-overlay-demo.

wbsouza avatar wbsouza commented on July 25, 2024 1

Thanks @mmoayyed for your feedback, I would like to contribute with the CAS project, I thought Aspereo was a company and owner of the product. Maybe because I don't have much experience working on open source projects. I don't have much intimacy with the CAS internals, so I'm going to report this problem in the forum and contribute as much as I can to solve this problem. Done!

from cas-overlay-demo.

wbsouza avatar wbsouza commented on July 25, 2024

I have the same problem running on Windows 7

from cas-overlay-demo.

leleuj avatar leleuj commented on July 25, 2024

I'm on MacOS X now so I don't have Windows issues anymore ;-) I guess you already tried to clean the Temp directory before starting the webapp?

from cas-overlay-demo.

wbsouza avatar wbsouza commented on July 25, 2024

I have cleaned manually, restart the windows and the problem still persist. For while I have decided move back to the 4.1.8 CAS version (working on windows 7) because the version 5 seems not fully mature. Hopefully I can integrate with pac4j and spring-boot (next steps).

from cas-overlay-demo.

leleuj avatar leleuj commented on July 25, 2024

I have successfully used the version 5 a couple of times (on MacOS X though). Did you report this problem on the CAS mailing list?
@mmoayyed Have you ever heard about this problem on Windows?

from cas-overlay-demo.

wbsouza avatar wbsouza commented on July 25, 2024

I tested with Mac and Linux is working fine, the problem is specific with windows when the Management starts try to delete the service files (json) and the files is still being used. I believe those files is still opened by the cas webapp. The same problem happen even with the 5.0.4 version (supposedly stable)

cas-server-logs.zip

from cas-overlay-demo.

leleuj avatar leleuj commented on July 25, 2024

Reading: https://github.com/apereo/cas/blob/5.0.x/core/cas-server-core-services/src/main/java/org/apereo/cas/services/AbstractResourceBasedServiceRegistryDao.java, I don't see anything which could explain your specific issue. I guess it's only because of Windows.

from cas-overlay-demo.

wbsouza avatar wbsouza commented on July 25, 2024

I found what is going on already, but I believe the people from CAS should change the approach to register the services.

Differently of *nix systems, the Windows lock a file when it is opened (even just for read). It seems there is one or more scheduled tasks reloading the directory "${java.io.tmpdir}/cas/services". I believe is a good idea to use a explicit lock file (opened for loading) in the temp directory and if the lock file exists do not try to delete because it's being used.

To verify that it was happening, first I executed the server and management using different temp directory

 java -jar -Djava.io.tmpdir=c:\temp\cas cas-overlay-server-demo\target\cas.war
 java -jar -Djava.io.tmpdir=c:\temp\mgr cas-overlay-management-demo\target\cas-management.war

And the errors was became less frequent (loading almost always with success the cas server).

To prove that has an process scheduled I made a couple changes: Created new classes under cas-overlay-server-demo using System.out.println to show when the file is being loaded.
cas-overlay-server-demo.zip

After to see this, I believe the version 5.0.4 is still not tested on Windows systems.

I guess the best way to solve this problem is to create my own class implementing the ServiceRegistryDao interface. With this approach I can implement in a way that if the file is being used (lock files for example) don't try to delete it. What do you think?

from cas-overlay-demo.

mmoayyed avatar mmoayyed commented on July 25, 2024

Thanks very much! and excellent work. I would be more than glad to guide you along the internals as much as possible. Lets carry on the conversation on the list and aim towards your first contribution and patch, which is absolutely more than welcome any day and time :)

from cas-overlay-demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.