[Beginner's Corner] - Re: Secure access to an EJB3.0
by Wolfgang Knauf
Wolfgang Knauf [http://community.jboss.org/people/WolfgangKnauf] created the discussion
"Re: Secure access to an EJB3.0"
To view the discussion, visit: http://community.jboss.org/message/589023#589023
--------------------------------------------------------------
Hi Pablo,
in AS 4.2, you might use something like this:
public class SecurityClientCallbackHandler implements CallbackHandler
{
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
{
//loop over parameter Callbacks
for (int intIndexCallback = 0; intIndexCallback < callbacks.length; intIndexCallback++)
{
//NameCallback: set Login
if (callbacks[intIndexCallback] instanceof NameCallback)
{
NameCallback nameCallback = (NameCallback) callbacks[intIndexCallback];
nameCallback.setName( "ADMIN" );
}
//PasswordCallback: set password.
else if (callbacks[intIndexCallback] instanceof PasswordCallback)
{
PasswordCallback passwordCallback = (PasswordCallback) callbacks[intIndexCallback];
passwordCallback.setPassword ("ADMIN".toCharArray() );
}
else
{
throw new UnsupportedCallbackException (callbacks[intIndexCallback], "Unsupported Callback!");
}
}
}
}
And in your client, perform this code to login in:
Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
props.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
props.setProperty("j2ee.clientName", "SecurityClient");
InitialContext initialContext = new InitialContext(props);
//Initialize Login:
SecurityClientCallbackHandler callbackHandler = new SecurityClientCallbackHandler();
LoginContext loginContext = new LoginContext ("somename", callbackHandler);
loginContext.login();
Note the the "j2ee.clientName" must be declared in a file "jboss-client.xml":
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.2//EN" " http://www.jboss.org/j2ee/dtd/jboss-client_4_2.dtd http://www.jboss.org/j2ee/dtd/jboss-client_4_2.dtd" >
<jboss-client>
<jndi-name>SecurityClient</jndi-name>
...
</jboss-client>
And the "login context" name (here: "somename") must be declared in a file "auth.conf" in META-INF of your client JAR:
somename {
// jBoss LoginModule
org.jboss.security.ClientLoginModule required
;
};
And finally, start your client with a parameter pointing to "auth.conf": -Djava.security.auth.login.config=.../META-INF/auth.conf
Hope this helps
Wolfgang
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/589023#589023]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 1 month
[JBoss Microcontainer] - More on BaseClassLoader conflict with Instrumentation....
by Ted Hulick
Ted Hulick [http://community.jboss.org/people/Ted.Hulick%40hp.com] created the discussion
"More on BaseClassLoader conflict with Instrumentation...."
To view the discussion, visit: http://community.jboss.org/message/588412#588412
--------------------------------------------------------------
Maybe would be best to spell out the architecture of my issue:
* At runtime, I add a group of jars to sun.misc.Loader$AppLoader containing some instrumentation using the addURL method, the code in these jars make reference to some jms classes. I also include jms.jar as part of this
* An EAR/WAR is loaded which is instrumented (bytecode modified) and make reference to the code in the jars put in the sun class loader. This WAR also has a jms.jar file - these classes are loaded into the JBoss "BaseClassLoader".
* The classes in the BaseClassLoader pick up the classes from the sun Class Loader just fine - evidently, the BaseClassLoader IS delegating to the
sun base Class Loader EVEN THOUGH it shows that it's parent is NOT the base loader (which I normally see), but instead the parent being
null indicating a native or boot loader.
* The problem comes when code in the sun loader is called by the code in the BaseClassLoader and the javax.jms.Session interface seems to be loaded into the BaseClassLoader from jms.jar in the WAR (self first? as it DID NOT delegate down to the sun Class Loader) and all comes
apart when a class impl for javax.jms.Session created in the BaseClassLoader is then cast to javax.jms.Session in the sun Class Loader and
because they were loaded in 2 different class loaders they are not considered the same class and we get a Class Cast Exception.
***** I want to either at runtime set the Classpath for the BaseClassLoader to my instrumentation classes which would resolve this issue OR
force ALL class loaders to delegate downstream to the jms.jar that I loaded in the sun AppClassLoader....
**
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/588412#588412]
Start a new discussion in JBoss Microcontainer at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 1 month
[jBPM] - Integrating jBPM BPMNModelEditor with eclipse RCP
by Lokesh Shiva Ramu
Lokesh Shiva Ramu [http://community.jboss.org/people/lokeshsan] created the discussion
"Integrating jBPM BPMNModelEditor with eclipse RCP"
To view the discussion, visit: http://community.jboss.org/message/589263#589263
--------------------------------------------------------------
Hi,
I have to integrate BPMNModelEditor with my RCP client. I need to show the BPMNModelEditor as a page in a multipage editor. None of the classes in the plugin "org.drools.eclipse" are exported, therefore I cannot use them. No other means provided to plug to this editor. When I try to open this editor by passing an IStorageEditorInput instance. I get following exceptions.
java.lang.IllegalArgumentException: Unknown model object null
at org.drools.eclipse.flow.ruleflow.editor.editpart.RuleFlowEditPartFactory.createEditPart(RuleFlowEditPartFactory.java:96)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:626)
at org.drools.eclipse.flow.common.editor.GenericModelEditor.initializeGraphicalViewer(GenericModelEditor.java:177)
at org.eclipse.gef.ui.parts.GraphicalEditor.createGraphicalViewer(GraphicalEditor.java:158)
at org.eclipse.gef.ui.parts.GraphicalEditorWithPalette.createPartControl(GraphicalEditorWithPalette.java:63)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
at org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(WorkbenchPage.java:1268)
What I could see from code is, there is an assumption that the IEditorInput to the editor will always be of type IFileEditorInput. The createModel() function in BPMNModelEditor, does a type cast with this assumption. If there is a failure in constructing model, then null is set as model.
Can BPMNModelEditor be integrated with RCP application. What is the best way to provide a jBPM editor in eclipse RCP. I am not particular to open the jBPM editor as part of page. Even if its a standalone page its fine. I cannot show .jbpm files in my RCP. I need to open jBPM editor based on stream based editor input.
Any one who has integrated the BPMNModelEditor in there RCP application ?
Any suggestion is hightly appreciated.
Thanks and Regards,
Lokesh
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/589263#589263]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 1 month
[JBoss Messaging] - JMS not able to perform failover
by rajeev kumar
rajeev kumar [http://community.jboss.org/people/rajeev.aec] created the discussion
"JMS not able to perform failover"
To view the discussion, visit: http://community.jboss.org/message/589250#589250
--------------------------------------------------------------
we have two IBM M2 having debian linux installed, on one server called as Master node we installed Jboss AS 4.2.3 and postgre 8.3(running) and on other server called as slave node we installed Jboss AS 4.2.3 and postgre 8.3 (not running), our both jboss is up and running in clustered environment, with both jboss sending data to the master node we also have corosync service running on background on both servers . now if master node goes down (whatever be the reason), corosync on slave node listen this and starts the postgre on slave system, and at the same time JMS on slave node also starts its failover, most of the time JMS do not able to perform its failover , but for few time everything goes right and Jboss start behavioung correctly after JMS failover , can any one please help me what may have goes wrong.
we are using following versions:
1) Jboss 4.2.3
2) JMS 1.4.2 SP2
3) Postgre
mean while I found the
https://issues.jboss.org/browse/JBMESSAGING-1781?page=com.atlassian.jira.... https://issues.jboss.org/browse/JBMESSAGING-1781?page=com.atlassian.jira....
is this the same issuse which I am facing?
regards,
rajeev
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/589250#589250]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 1 month
[jBPM] - Problem running jBPM 5 demo
by Adam Bach
Adam Bach [http://community.jboss.org/people/heathcliff] created the discussion
"Problem running jBPM 5 demo"
To view the discussion, visit: http://community.jboss.org/message/588778#588778
--------------------------------------------------------------
Hi,
I've downloaded the full installer of jpm5.0 and run install.demo. I finished with no problems. After that I tryed to run start.demo but It hanged bacouse of jboss. So I tryed to run jboss my sefl and I got firewall warning, I made the app my trusted on. The demo run with no problem. I played with it like 5 min and shut it all down. Since than I can't run jboss or demo, I always get the message:
Calling C:\Download\jbpm-5.0.0-installer-full\jbpm-installer\jboss-5.1.0.GA\bin\
run.conf.bat
W tym momencie \apache-ant\bin";;C:\Download\jbpm-5.0.0-installer-full\jbpm-inst
aller\jboss-5.1.0.GA\bin" było nieoczekiwane.
W tym momencie == At this moment
było nieoczekiwane == was unexpected.
Any one knows whats wrong???
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/588778#588778]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 1 month