[JBoss AS 7 Development] - ClientLoginModule support
by Tarek Hammoud
Tarek Hammoud [https://community.jboss.org/people/thammoud] created the discussion
"ClientLoginModule support"
To view the discussion, visit: https://community.jboss.org/message/750773#750773
--------------------------------------------------------------
Hello,
We are migrating from JBOSS 4.x to 7.1.1. A client is trying to access a remote EJB. Previously, code like below worked by propogating the credentials to the server:
LoginContext lc = new LoginContext("client-login", new UsernamePasswordHandler(userName, password.toCharArray()));
lc.login();
....
InitialContext ctx = new InitialContext(...);
Server s = ctx.lookup();
s.invoke();
With 7.1.1, we are basically doing the same:
LoginContext lc = new LoginContext("client-login", new UsernamePasswordHandler(userName, password.toCharArray()));
lc.login();
......
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
jndiProps.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
jndiProps.put("jboss.naming.client.ejb.context", true);
jndiProps.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS", "JBOSS-LOCAL-USER");
Context ctx = new InitialContext(jndiProps); *<<=== Throws exception*
Caused by: javax.security.sasl.SaslException: Cannot get userid/password [Caused by javax.security.auth.callback.UnsupportedCallbackException]
at com.sun.security.sasl.ClientFactoryImpl.getUserInfo(ClientFactoryImpl.java:157)
at com.sun.security.sasl.ClientFactoryImpl.createSaslClient(ClientFactoryImpl.java:94)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities$1.run(ClientConnectionOpenListener.java:352)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities$1.run(ClientConnectionOpenListener.java:350)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:350)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:214)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.nio.NioHandle.run(NioHandle.java:90)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:184)
at ...asynchronous invocation...(Unknown Source)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:251)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:349)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:333)
at org.jboss.naming.remote.client.EndpointCache$EndpointWrapper.connect(EndpointCache.java:105)
at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:55)
... 8 more
We would like to avoid having to sepcify the credentials as part of the InitialContext properties. Any help will be greatly appreciated.
Thank you
Tarek Hammoud
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/750773#750773]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 2 months
[JBoss AS 7 Development] - Re: CLI non-interactive mode improvements
by Alexey Loubyansky
Alexey Loubyansky [https://community.jboss.org/people/aloubyansky] created the discussion
"Re: CLI non-interactive mode improvements"
To view the discussion, visit: https://community.jboss.org/message/714239#714239
--------------------------------------------------------------
About the environment properties, makes sense. Although, I think it's a different issue from interactive value prompting.
While conditions and force are interesting features, you can achieve repeatable script executions by using batches which make a script an atomic action, i.e. everything in the script will be applied or rolled back.
The force in the suggested form (for operations especially) won't be implemented. For some commands, perhaps. In general, though, I, personally, don't like the idea... but I see your point. Conditions are interesting.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/714239#714239]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 2 months
[JBoss AS 7 Development] - org.hibernate.internal.SessionImpl cannot be cast to org.hibernate.classic.Session
by Machara Rao P
Machara Rao P [https://community.jboss.org/people/machararao] created the discussion
"org.hibernate.internal.SessionImpl cannot be cast to org.hibernate.classic.Session"
To view the discussion, visit: https://community.jboss.org/message/751185#751185
--------------------------------------------------------------
HI
I am newly joined in this community! i am facing some issue when i try to use Hibernate Search in JBoss 7 i am getting following exception
14:46:01,104 WARN [org.hibernate.internal.SessionFactoryImpl] (http-localhost-127.0.0.1-8079-1) HHH000008: JTASessionContext being used with JDBCTransactionFactory; auto-flush will not operate correctly with getCurrentSession()
14:47:32,172 ERROR [stderr] (http-localhost-127.0.0.1-8079-2) java.lang.ClassCastException: org.hibernate.internal.SessionImpl cannot be cast to org.hibernate.classic.Session
14:47:32,174 ERROR [stderr] (http-localhost-127.0.0.1-8079-2) at org.hibernate.search.impl.FullTextSessionImpl.<init>(FullTextSessionImpl.java:105)
14:47:32,174 ERROR [stderr] (http-localhost-127.0.0.1-8079-2) at org.hibernate.search.Search.getFullTextSession(Search.java:45)
14:47:32,175 ERROR [stderr] (http-localhost-127.0.0.1-8079-2) at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.getFullTextSession(FullTextEntityManagerImpl.java:71)
14:47:32,176 ERROR [stderr] (http-localhost-127.0.0.1-8079-2) at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.createFullTextQuery(FullTextEntityManagerImpl.java:100)
please help me solving this issue
Thanks in advance
Machara
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/751185#751185]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 2 months
[JBoss AS 7 Development] - quartz-service.xml Jboss7.1
by rathm1
rathm1 [https://community.jboss.org/people/rathm1] created the discussion
"quartz-service.xml Jboss7.1"
To view the discussion, visit: https://community.jboss.org/message/721223#721223
--------------------------------------------------------------
Hi there,
I am trying to deploy my quartz-service.xml in Jboss7.1, previously we had it working in Jboss4.2.3 and Jboss6.1.0.
I have the quartz-1.8.5.jar and the quartz-jboss-1.8.5.jar in the lib directory of my ear.
When I try placing the quartz-service.xml in my standalone/deployments folder I get the error:
[org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."quartz-service.xml".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."quartz-service.xml".INSTALL: Failed to process phase INSTALL of deployment "quartz-service.xml"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
Caused by: java.lang.IllegalArgumentException: JBAS017220: Class not found
at org.jboss.as.service.ReflectionUtils.getClass(ReflectionUtils.java:115)
at org.jboss.as.service.ReflectionUtils.getClassHierarchy(ReflectionUtils.java:122)
at org.jboss.as.service.ParsedServiceDeploymentProcessor.addServices(ParsedServiceDeploymentProcessor.java:108)
at org.jboss.as.service.ParsedServiceDeploymentProcessor.deploy(ParsedServiceDeploymentProcessor.java:99)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
... 5 more
Caused by: java.lang.ClassNotFoundException: org.quartz.ee.jmx.jboss.QuartzService from [Module "deployment.quartz-service.xml:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_26]
at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_26]
at org.jboss.as.service.ReflectionUtils.getClass(ReflectionUtils.java:113)
... 9 more
My quartz-service.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="org.quartz.ee.jmx.jboss.QuartzService"
name="user:service=QuartzService,name=QuartzService">
<depends>jboss.jca:service=DataSourceBinding,name=MyDS</depends>
<attribute name="Properties">
org.quartz.scheduler.instanceName = DefaultQuartzScheduler
org.quartz.scheduler.rmi.export = false
org.quartz.scheduler.rmi.proxy = false
org.quartz.scheduler.xaTransacted = false
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 5
org.quartz.threadPool.threadPriority = 4
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.dataSource = QUARTZ
org.quartz.jobStore.nonManagedTXDataSource = QUARTZ_NO_TX
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.dataSource.QUARTZ.jndiURL = java:jboss/datasources/MyDS
org.quartz.dataSource.QUARTZ_NO_TX.jndiURL = java:jboss/datasources/MyNoTxDS
</attribute>
</mbean>
</server>
Does anyone have any suggestions as to how this should be configured in jboss 7.1?
Thanks a lot.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/721223#721223]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 3 months
[JBoss AS 7 Development] - Migrating from AS4 to AS7 - Problem loading view templates
by Neil Doshi
Neil Doshi [https://community.jboss.org/people/ndoshi] created the discussion
"Migrating from AS4 to AS7 - Problem loading view templates"
To view the discussion, visit: https://community.jboss.org/message/744935#744935
--------------------------------------------------------------
I am migrating my spring mvc web app from AS4 to AS7.
The application is having a hard time finding my view templates (we are using velocity templates for our view).
This currently works fine in AS4 as is.
The project structure is as follows:
/
/src
/com
(etc...)
/WebContent
/WEB-INF
/velocity
/login
/login.vm
Here is an excerpt from my spring config file:
Stack Trace:
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/WEB-INF/velocity/login/login.vm'
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:483)
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:354)
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1400)
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1380)
org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:401)
org.springframework.web.servlet.view.velocity.VelocityView.getTemplate(VelocityView.java:535)
org.springframework.web.servlet.view.velocity.VelocityView.getTemplate(VelocityView.java:520)
org.springframework.web.servlet.view.velocity.VelocityView.checkTemplate(VelocityView.java:293)
org.springframework.web.servlet.view.velocity.VelocityLayoutView.checkTemplate(VelocityLayoutView.java:122)
org.springframework.web.servlet.view.velocity.VelocityView.initApplicationContext(VelocityView.java:258)
org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:341)
org.springframework.web.servlet.view.UrlBasedViewResolver.loadView(UrlBasedViewResolver.java:413)
org.springframework.web.servlet.view.AbstractCachingViewResolver.createView(AbstractCachingViewResolver.java:159)
org.springframework.web.servlet.view.UrlBasedViewResolver.createView(UrlBasedViewResolver.java:378)
org.springframework.web.servlet.view.AbstractCachingViewResolver.resolveViewName(AbstractCachingViewResolver.java:78)
org.springframework.web.servlet.DispatcherServlet.resolveViewName(DispatcherServlet.java:1215)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1164)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:902)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
I tried a few different options for the "prefix" property
* /WEB-INF/velocity/
* WEB-INF/velocity/
* customerportal.war/WEB-INF/velocity/
* com.odc.customerportal/WEB-INF/velocity/
I am able to reorganize the location of the files in the built war file if necessary.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/744935#744935]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 3 months