[JBoss Web Services] New message: "JBoss 6.0.0 M1 and Authenticator not appearing to work"
by Ian Ian
User development,
A new message was posted in the thread "JBoss 6.0.0 M1 and Authenticator not appearing to work":
http://community.jboss.org/message/519962#519962
Author : Ian Ian
Profile : http://community.jboss.org/people/hirowla
Message:
--------------------------------------------------------------
Hi, I'm having some issues with calling an external web service from JBoss 6.0.0 M1. I'm using the "standard" server if that has an impact.
The external web service using basic authentication, so I use Authenticator.setDefault() to set a custom Authenticator, which provides the username and password. However this has no effect and when I debug the server, the Authenticator is never called. This would explain it.
However when I run exactly the same code as a standalone client (I added a main method to the class), the Authenticator is called and everything works how I would expect it.
Is there a restriction on Authenticator.setDefault() in JBoss 6.0.0 M1? Am I not allowed to call Authenticator.setDefault() (or is it silently ignored when I call it)? Or can I do it but then, why is my authenticator not being called?
Here is the basic code that does the call:
Authenticator.setDefault(new BroadcastAuthenticator(username, password)); // Constructing my authenticator
CommsIncomingMessageService service = new CommsIncomingMessageService(); // My web service
CommsIncomingMessage requestInvoker = service.getCommsIncomingMessagePort(); // Getting an instance of it
BindingProvider provider = (BindingProvider)requestInvoker;
provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
provider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
provider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
requestInvoker.invokeMessage(message);
Any ideas, before I pull out what remaining hair I have?
Thanks,
Ian
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/519962#519962
16 years, 3 months
How to properly use own JSF and Hibernate implementations on JBoss 4.2.3?
by Wojciech Ciesielski
Hi there,
I can't get a grip on classloader configuration in JBoss :( I did not
manage to force my .war to use it's own JSF (RI 1.2) and Hibernate
(3.3.1) implementations without problems.
What I was able to do was to pack my WAR into an EAR - after moving
libs from WAR to <ear>/lib and adding this to jboss-app.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-app PUBLIC
"-//JBoss//DTD J2EE Application 1.4//EN"
"http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
<jboss-app>
<loader-repository>com.mycomp:loader=mycomp-www-ear.ear<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</jboss-app>
But I get class cast exceptions - it seems that classes loaded by
web-app classloader are not regarded the same as those loaded by EAR
classloader. So my question is:
What is a proper way to accomplish what I need to accomplish
(overriding default JSF and Hibernate implementations - in fact either
setting classloader priority "EAR/WAR first, server's libs next" or
complete separation - not using server's lib at all - if that's
required)?
Precise questions are:
1. where should I put my libs?
2. what should I add to jboss-specific deployment descriptors?
3. is this possible to force JBoss to use common classloader for EAR
and embedded WARs so classes loaded by them are regarded same and do
not cause ClassCastExceptions ?
I swear I tried to google this out, but I could not find proper
documentation for this particular JBoss version...
TIA,
Wojtek
16 years, 3 months
[Beginner's Corner] New message: "How to limit the stateful SB pool size?"
by Tony Bryan
User development,
A new message was posted in the thread "How to limit the stateful SB pool size?":
http://community.jboss.org/message/519955#519955
Author : Tony Bryan
Profile : http://community.jboss.org/people/tonybryan
Message:
--------------------------------------------------------------
I'm trying to pick up the basics of EJB3 and JBoss. I'm following a tutorial that demonstrates the stateful session bean lifecycle, forcing passivation and activation, by limiting the pool of stateful session beans to one less than the number in use.
How is this achieved? With EJB3, can I write a +jboss.xml+ file as follows?
<
jboss>
<enterprise-beans >
<session>
<ejb-name>CountBean</ejb-name>
<configuration-name>Limited Poolsize Stateful SessionBean</configuration-name>
</session>
</enterprise-beans>
<container-configurations >
<container-configuration extends=+"Standard Stateful SessionBean"+>
<container-name>Limited Poolsize Stateful SessionBean</container-name>
<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
<cache-policy-conf>
<max-capacity>2</max-capacity>
</cache-policy-conf>
</container-cache-conf>
<container-pool-conf>
<MaximumSize>2</MaximumSize>
<strictMaximumSize>true</strictMaximumSize>
</container-pool-conf>
</container-configuration>
</container-configurations>
</jboss>
If I deploy the bean with this jboss.xml file in the META-INF folder then the bean works but does not passivate and activate. Is my +jboss.xml+ file correct? Do I need to deploy it somewhere else?
I found this post online: http://community.jboss.org/message/515942#515942
If I follow the direction in this post, to instead modify the +ejb3-interceptors-aop.xml+ file, then I get the desired result, but this method is more complex and I haven't read anything that says EJB3 doesn't suppor the jboss.xml file.
Can anyone confirm the simplest way to limit the pool of stateful session beans, both generically, and on a per bean class basis?
Thanks!
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/519955#519955
16 years, 3 months