[JBoss AS 7 Development] - Re: Remote EJB Client Security (Jboss7.1)
by rathm1
rathm1 [https://community.jboss.org/people/rathm1] created the discussion
"Re: Remote EJB Client Security (Jboss7.1)"
To view the discussion, visit: https://community.jboss.org/message/720385#720385
--------------------------------------------------------------
Thanks for the help!
The winning combination was...
jboss-ejb-client.properties
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port=4447
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=JBOSS-LOCAL-USER
Client Application Code:
final Properties jndiProperties = new Properties();
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, org.jboss.naming.remote.client.InitialContextFactory.class.getName());
jndiProperties.put(Context.PROVIDER_URL, "remote://localhost:4447");
jndiProperties.put("jboss.naming.client.ejb.context", true);
jndiProperties.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
jndiProperties.put(Context.SECURITY_PRINCIPAL, username);
jndiProperties.put(Context.SECURITY_CREDENTIALS, password);
Context context = new InitialContext(jndiProperties);
String lookUp = appName + "/" + moduleName + "/" + beanName + "!" + interfaceClassName;
TestEJB facade = (TestEJB)context.lookup(lookUp);
boolean connectionSuccessful = facade.canConnect();
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/720385#720385]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months
[JBoss AS 7 Development] - BeanDefinitionParsingException :: Spring NamespaceHandler
by Ranendra Das
Ranendra Das [https://community.jboss.org/people/ranendas] created the discussion
"BeanDefinitionParsingException :: Spring NamespaceHandler"
To view the discussion, visit: https://community.jboss.org/message/739056#739056
--------------------------------------------------------------
Hello,
I am trying to deploy a portlet war file with Spring 3.1 in Jboss 7.0.2 - Liferay6.1, but when I deploy, I get following error, what could be the reason, anyone knows? Plz help me.
This is the error stack trace:-
14:46:09,504 ERROR [org.springframework.web.portlet.DispatcherPortlet] (MSC service thread 1-2) Context initialization failed: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [ http://www.springframework.org/schema/context http://www.springframework.org/schema/context]
Offending resource: PortletContext resource [/WEB-INF/oneprmpendinguserrequests-portlet.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:316) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1416) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1409) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) [org.springframework.beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.context.XmlPortletApplicationContext.loadBeanDefinitions(XmlPortletApplicationContext.java:125) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.context.XmlPortletApplicationContext.loadBeanDefinitions(XmlPortletApplicationContext.java:93) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131) [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522) [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436) [org.springframework.context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.FrameworkPortlet.createPortletApplicationContext(FrameworkPortlet.java:356) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.FrameworkPortlet.initPortletApplicationContext(FrameworkPortlet.java:294) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.FrameworkPortlet.initPortletBean(FrameworkPortlet.java:268) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.portlet.GenericPortletBean.init(GenericPortletBean.java:120) [org.springframework.web.portlet-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at javax.portlet.GenericPortlet.init(GenericPortlet.java:107) [portlet.jar:private-2011/04/13-23:33:42]
at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:246)
at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:216)
at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:139)
at com.liferay.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:40) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:310)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:524)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:302)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:115)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:111) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:188) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:40) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletContextListener.java:101) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:45) [portal-service.jar:private-2011/04/13-23:33:42]
at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:833)
Regards,
RD
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/739056#739056]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months
[JBoss AS 7 Development] - JSR88 deployment to JBoss in AS 7.1.0 not working properly. (giving improper Deployment URL)
by PIYUSH MUNDRA
PIYUSH MUNDRA [https://community.jboss.org/people/piy26] created the discussion
"JSR88 deployment to JBoss in AS 7.1.0 not working properly. (giving improper Deployment URL)"
To view the discussion, visit: https://community.jboss.org/message/739065#739065
--------------------------------------------------------------
Hi,
I am trying to use JSR88 deployment to JBoss as per the instructions provided in https://community.jboss.org/wiki/JSR88Client/diff?secondVersionNumber=16&...
I want to deploy a test.war file using JSR88 implementation provided by JBOSS.
However, My test.war file gets uploaded at location as *$JBOSS_HOME\standalone\data\content\d7\37f7368101b293d280c225326dd8774aa315c1\content*
but the war gets registered within standalone.xml as:
<deployments>
<deployment name="file:/C:/Users/thisuser/AppData/Local/Temp/test.war" runtime-name="file:/C:/Users/thisuser/AppData/Local/Temp/test.war">
<content sha1="d737f7368101b293d280c225326dd8774aa315c1"/>
</deployment>
</deployments>
Thus the context created for the deployed war is of form /file:/C:/Users/thisuser/AppData/Local/Temp/test.war.
I followed the code sample for AS 7 as mentioned in the above JBOSS WIKI link.
While browsing through code from SVN for org.jboss.as.ee.deployment.spi.DeploymentManagerImpl.java
private TargetModuleInfo createDeployment(InputStream moduleArchive, String moduleName)
{
....
....
line:470
*String deploymentName = tmpFile.getParent() + File.separator + this.metaData.getDeploymentName();*
* *
* File deployment = new File(deploymentName);*
* if ((deployment.exists()) && (!(deployment.delete())))*
* throw new IOException(DeploymentMessages.MESSAGES.cannotDeleteExistingDeployment(deployment));*
* *
* tmpFile.renameTo(deployment);*
* moduleInfo.setModuleID(deployment.toURI().toURL());*
* return moduleInfo;*
*}*
It seems that what is set in moduleInfo is not the actual name of the WAR but the entire temporary path at which it gets created at server during the process of deployment.
This results in the deployment name and runtime-name of the context to be a complete FILE URI rather that the actual context name.
Requesting to please comment on my observation. Is there anything within the process of JSR88 deployment that I am missing or am I missing any configuration ?
Is the code observation a cause of the problem ?
Thanks in advance.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/739065#739065]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months
[JBoss AS 7 Development] - Lookup failure of UserTransaction
by 栗原 政彦
栗原 政彦 [https://community.jboss.org/people/kuribara] created the discussion
"Lookup failure of UserTransaction"
To view the discussion, visit: https://community.jboss.org/message/736178#736178
--------------------------------------------------------------
Lookup failure of UserTransaction
Standanone Java Aplication is made, and it tries to do the EJB call with Remote.
Because UserTransaction is not good at lookup, I am embarrassed.
Is the specification of the JNDI name bad?
Environment
==========
Red Hat Enterprise Linux Server release 5.5 Beta (Tikanga)
JBossAS7.1.0 Final
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) Server VM (build 22.0-b10, mixed mode)
It tries to access Remote EJB by using jboss-client-7.1.0.Final.jar
SourceCode
==========
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL,"remote://localhost:4447");
env.put(Context.SECURITY_PRINCIPAL, "apuser");
env.put(Context.SECURITY_CREDENTIALS, "apuserpass");
context = new InitialContext(env);
UserTransaction userTransaction = (UserTransaction) context.lookup("java:comp/UserTransaction");
At lookup, the following exception is generated.
javax.naming.NameNotFoundException: comp/UserTransaction -- service jboss.naming.context.java.jboss.exported.comp.UserTransaction
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:177)
at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:124)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:70)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Relating file
========
jndi.properties
===============
java.naming.provider.url=remote://localhost:4447
java.naming.factory.url.pkgs=org.jboss.ejb.client.naming
jboss-ejb-client.properties
===========================
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port=4447
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.username=admin
remote.connection.default.password=password
Supplementation matter
Security has been added with add-user.sh as an application user. apuser/apuserpass
Referred URL
==========
EJB invocations from a remote client using JNDI
https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+... https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+...
Examples of JNDI mappings in previous releases and how they might look now
https://docs.jboss.org/author/display/AS71/How+do+I+migrate+my+applicatio... https://docs.jboss.org/author/display/AS71/How+do+I+migrate+my+applicatio...
UserTransaction
New Namespaces
java:comp/UserTransaction
java:jboss/UserTransaction
Neither lookup can be done.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/736178#736178]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months
[JBoss AS 7 Development] - TransactionRequiredException: JBAS011469: Transaction is required to perform this operation
by Hiep Le Canh
Hiep Le Canh [https://community.jboss.org/people/canhhiep] created the discussion
"TransactionRequiredException: JBAS011469: Transaction is required to perform this operation"
To view the discussion, visit: https://community.jboss.org/message/738946#738946
--------------------------------------------------------------
Hi,
I have this exception when I am running my app in JBoss 7.1.1 Final:
14:43:23,901 ERROR [stderr] (http--127.0.0.1-8080-2) Caused by: javax.persistence.TransactionRequiredException: JBAS011469: Transaction is required to perform this operation (either use a transaction or extended persistence context)
14:43:23,903 ERROR [stderr] (http--127.0.0.1-8080-2) at org.jboss.as.jpa.container.AbstractEntityManager.transactionIsRequired(AbstractEntityManager.java:692)
14:43:23,904 ERROR [stderr] (http--127.0.0.1-8080-2) at org.jboss.as.jpa.container.AbstractEntityManager.merge(AbstractEntityManager.java:547)
14:43:23,907 ERROR [stderr] (http--127.0.0.1-8080-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:43:23,908 ERROR [stderr] (http--127.0.0.1-8080-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
14:43:23,909 ERROR [stderr] (http--127.0.0.1-8080-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
:25)
14:43:23,910 ERROR [stderr] (http--127.0.0.1-8080-2) at java.lang.reflect.Method.invoke(Method.java:597)
14:43:23,911 ERROR [stderr] (http--127.0.0.1-8080-2) at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferen
ceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)
14:43:23,914 ERROR [stderr] (http--127.0.0.1-8080-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
14:43:23,916 ERROR [stderr] (http--127.0.0.1-8080-2) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.jav
a:374)
I think this piece of code make exception is:
public int getSomething() throws Exception {
try {
// this code make exception
} catch (NoSuchUserException x) {
//do nothing here
}
}
The excepion is already catch, and does not throw to the caller, but it seems that the transaction is marked as rollback, so transaction cannot be commited.
The above code has worked fine in both JBoss 5 and 7.0.2, but in JBoss 7.1.1 Final the TransactionRequiredException is thrown and transaction fails. Could you please let me know how to config to make the transaction still exist in case exception happen but was catched ?.
Thanks
Hiep
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/738946#738946]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 6 months