[ 
https://issues.apache.org/jira/browse/FC-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15560817#comment-15560817
 ] 

Shawn McKinney commented on FC-192:
-----------------------------------

sonarqube gave this error on UserP's usage of UserDAO why I changed to 
non-static, triggering the error.


Dodgy - Write to static field from instance method
Permalink
findbugs:ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD

    No tags Reliability > Architecture related reliability 

This instance method writes to a static field. This is tricky to get correct if 
multiple instances are being manipulated, and generally bad practice.

This rule is deprecated, use S2696 instead.
Close


> [ fortress-core ] problems with config system
> ---------------------------------------------
>
>                 Key: FC-192
>                 URL: https://issues.apache.org/jira/browse/FC-192
>             Project: FORTRESS
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Shawn McKinney
>            Assignee: Shawn McKinney
>             Fix For: 2.0.0-RC1
>
>
> Problem appeared recently with fortress-web.  One of the config variables, 
> user.objectClass, could not be found causing a problem with the fortress load 
> utility's user create.  
> The error from log is below.  Notice the values of the user's object class 
> has 'null' for 2nd value.
> After troubleshooting I discovered the problem occurred due to a recent 
> change of UserDAO var decl in UserP to a non-static:
> // TODO: Fixme - This variable must remain static for now or the config 
> bootstrap doesn't work right:
>     private static UserDAO uDao;
> After returning the value to static as shown the problem went away.
> This is fragile and needs to be fixed so that making simple changes like this 
> don't break the config system.
> Error:
>  [startAnt] [FortressAdmin] DEBUG - 09 Oct 2016 15:59:27,297 - RegExUtil      
>             - safeText can't find safeText regular expression pattern.  Check 
> your Fortress cfg
>  [startAnt] [FortressAdmin] DEBUG - 09 Oct 2016 15:59:27,298 - Config         
>             - getProperty name [user.root] value [ou=People,dc=example,dc=com]
>  [startAnt] [FortressAdmin] ******* OBJECT CLASS=top
>  [startAnt] [FortressAdmin] ******* OBJECT CLASS=null
>  [startAnt] [FortressAdmin] ******* OBJECT CLASS=ftUserAttrs
>  [startAnt] [FortressAdmin] ******* OBJECT CLASS=ftProperties
>  [startAnt] [FortressAdmin] ******* OBJECT CLASS=ftMods
>  [startAnt] [FortressAdmin] ******* OBJECT CLASS=extensibleObject
>  [startAnt] [FortressAdmin] DEBUG - 09 Oct 2016 15:59:27,298 - Config         
>             - getProperty name [pwpolicy.root] value 
> [ou=Policies,dc=example,dc=com]
>  [startAnt] [FortressAdmin] ****************************    
> pwpolicy.root=ou=Policies,dc=example,dc=com
>  [startAnt] [FortressAdmin] WARN  - 09 Oct 2016 15:59:27,299 - 
> FortressAntTask            - addUsers userId [test7] caught 
> SecurityException={}
>  [startAnt] [FortressAdmin] 
> org.apache.directory.fortress.core.CreateException: create userId [test7] 
> caught LDAPException=objectClass: value #1 invalid per syntax
>  [startAnt] [FortressAdmin]   at 
> org.apache.directory.fortress.core.impl.UserDAO.create(UserDAO.java:569)
>  [startAnt] [FortressAdmin]   at org.apa



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to