jboss 4.03 to 6.0 final and SecurityAssociation.getCallerPrincipal() null problem
pionierprog Apr 20, 2011 11:03 AMHi,
I dicieded to updated my app to the newest version of java and jboss road was long and painfull;) but each problem was solved with help of google;) but now have no ide what is going on and even how to ask google. My app client (swing) is connecting to server (jboss ejb3) application is asking for a username and password everything i type login and pass as i was asked to and appliaction is starting. After everything start up i try to get any resources and i get error SecurityAssociation.getCallerPrincipal() return null if i just switch to another user and retype my username and pass everyhing works fine. I think that the problem is with mutlithread session context http://docs.jboss.org/jbossas/docs/Server_Configuration_Guide/4/html/Security_on_JBoss-Running_JBoss_with_a_Java_2_security_manager.html but even if I run jboss with parameter
set JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.security.SecurityAssociation.setServer=false
it still return null pointer after application startup.
That what is in jboss server.log
2011-04-20 16:35:03,100 INFO [my.app.domain.CallbackManagerJBossService] (WorkerThread#0[127.0.0.1:54107]) registering new client with id: 1
2011-04-20 16:35:03,495 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for PRODUCT for user administrator
2011-04-20 16:35:07,987 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for CUSTOMER for user administrator
2011-04-20 16:35:10,165 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for PRICE_LIST_ITEM for user administrator
2011-04-20 16:35:10,715 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for WAREHOUSE_ITEM for user administrator
2011-04-20 16:35:11,501 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for UNIT for user administrator
2011-04-20 16:35:11,503 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for TAX_RATE for user administrator
2011-04-20 16:35:11,517 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for WAREHOUSE for user administrator
2011-04-20 16:35:11,556 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for OPERATOR for user administrator
2011-04-20 16:35:11,561 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for LOCATION for user administrator
2011-04-20 16:35:11,564 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for COUNTRY for user administrator
2011-04-20 16:35:11,567 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for DOCUMENT_ANNOTATION for user administrator
2011-04-20 16:35:11,739 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for DOCUMENT_INTERNAL_ANNOTATION for user administrator
2011-04-20 16:35:12,489 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for PRICE_LIST for user administrator
2011-04-20 16:35:12,491 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for CUSTOMER_GROUP for user administrator
2011-04-20 16:35:12,557 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for LOGISTIC_ROUTE for user administrator
2011-04-20 16:35:12,561 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for OWNER_DATA for user administrator
2011-04-20 16:35:12,563 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for OWNER_BANK_ACCOUNT for user administrator
2011-04-20 16:35:12,565 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for PRODUCT_GROUP for user administrator
2011-04-20 16:35:12,568 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for PRODUCT_SYSTEM for user administrator
2011-04-20 16:35:12,572 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for PRODUCT_SHEET_THICKNESS for user administrator
2011-04-20 16:35:12,575 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for PRODUCT_SHEET_LENGTH for user administrator
2011-04-20 16:35:12,577 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for PRODUCT_SHEET_MATERIAL for user administrator
2011-04-20 16:35:12,578 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for DEPARTMENT for user administrator
2011-04-20 16:35:12,581 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Fetching whole cache for STOCKTAKING for user administrator
2011-04-20 16:35:12,582 INFO [my.app.domain.CacheServiceEJB] (WorkerThread#0[127.0.0.1:54110]) Done fetching cache for user administrator
2011-04-20 16:35:55,643 ERROR [pl.wroc.si.baks.server.ExceptionHandlingInterceptor] (WorkerThread#0[127.0.0.1:54118]) Catched RuntimeException: java.lang.NullPointerException
at my.app.domain.server.SessionContext.findCallerPrincipalName(SessionContext.java:49) [:]
I have default run.bat wiht few new parameters :
set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%
set JAVA_OPTS=%JAVA_OPTS% -Djboss.platform.mbeanserver
set JAVA_OPTS=%JAVA_OPTS% -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl
set JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.security.SecurityAssociation.setServer=false
set JAVA_OPTS=%JAVA_OPTS% -Djava.security.debug=access,failure