[Security & JAAS/JBoss] - Using JAAS with Thread Pools
by leobaz2
My application consists of 2 EARs. One EAR has the web application and presentation logic. The other EAR consists of secured session EJBs.
In the Web App EAR I defined a ServletContextListener that will authenticate itself with the EAR containing the secured EJBs. I am doing this using the ClientLoginModule. The EAR with the secured EJBs contains a SAR that defines a custom login module where I also create a custom Principal.
My problem is that when a request comes in from the web application and that thread tries to access the secured EJBs, it fails saying I am unauthorized to do so. Does anyone know how to associate the calling thread with the security context created in the ServletContextListener?
During the JAAS authentication, I am storing the Subject returned from the login method. I have tried Subject.doAs but it doesn't work. I am porting my application from WebLogic where it works fine using the Subject.runAs provided by a WebLogic library.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193853#4193853
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193853
15 years, 6 months
[Beginners Corner] - problem trying to create new bean (EJB2.0)
by MikePhoenix
I'm trying to create a new entity bean for an existing application. When I deploy I get the following error:
anonymous wrote : org.jboss.deployment.DeploymentException: Field changeDate in prim-key-class must be of the same type.
New table sql
CREATE TABLE `projecthistory` (
| `ProjectId` int(11) NOT NULL default '0',
| `ChangeDate` datetime NOT NULL,
| `UserID` varchar(50) NOT NULL,
| `Status` int(11) NOT NULL default '0',
| PRIMARY KEY (`ProjectId`, `ChangeDate`),
| KEY `projecthistory_ProjectID_FK` (`ProjectId`),
| CONSTRAINT `projecthistory_ProjectID_FK` FOREIGN KEY (`ProjectId`) REFERENCES `projects` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
| );
prim-key in ejb-jar.xml
<prim-key-class>lingonet.projecthistory.ProjectHistoryKey</prim-key-class>
The key class
public class ProjectHistoryKey {
| public Integer projectID;
| public Date changeDate;
|
| public ProjectHistoryKey (Integer projectID, Date changeDate) {
| this.projectID = projectID;
| this.changeDate = changeDate;
| }
| }
|
I am using java.util.date in my java code, which works for other beans where the date isn't a primary key? Do I need to use java.sql.date or is there just a problem using dates in primary keys or something else entirely? Some guidance here would be appreciated.
Mike
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193849#4193849
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193849
15 years, 6 months
[EJB/JBoss] - problem with new bean I'm creating (EJB2.0)
by MikePhoenix
I'm trying to create a new entity bean for an existing application. When I deploy I get the following error:
anonymous wrote : org.jboss.deployment.DeploymentException: Field changeDate in prim-key-class must be of the same type.
New table sql
CREATE TABLE `projecthistory` (
| `ProjectId` int(11) NOT NULL default '0',
| `ChangeDate` datetime NOT NULL,
| `UserID` varchar(50) NOT NULL,
| `Status` int(11) NOT NULL default '0',
| PRIMARY KEY (`ProjectId`, `ChangeDate`),
| KEY `projecthistory_ProjectID_FK` (`ProjectId`),
| CONSTRAINT `projecthistory_ProjectID_FK` FOREIGN KEY (`ProjectId`) REFERENCES `projects` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
| );
prim-key in ejb-jar.xml
<prim-key-class>lingonet.projecthistory.ProjectHistoryKey</prim-key-class>
The key class
public class ProjectHistoryKey {
| public Integer projectID;
| public Date changeDate;
|
| public ProjectHistoryKey (Integer projectID, Date changeDate) {
| this.projectID = projectID;
| this.changeDate = changeDate;
| }
| }
|
I am using java.util.date in my java code, which works for other beans where the date isn't a primary key? Do I need to use java.sql.date or is there just a problem using dates in primary keys or something else entirely? Some guidance here would be appreciated.
Mike
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193845#4193845
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193845
15 years, 6 months
[Installation, Configuration & DEPLOYMENT] - Re: Performance parameters for JBOSS
by PeterJ
Use the JMX Console (http://localhost:8080/jmx-console). It lists all of the MBeans registered in JBossAS. Several of them contain performance information. Here are some examples, there are others:
For a data source named xxx, the following MBean provides information on the number of connections:
jboss.jca:name=xxx,service=ManagedConnectionPool
For HTTP connections, you can see the thread counts in
jboss.web:type=ThreadPool,name=http-99.99.99.99-8080
where 99.99.99.99 is your IP address.
For servlets, you can see processing times and number of requests in
jboss.web:j2eeType=Servlet,J2EEserver=none,J2EEApplication=xxx,WebModule=//hostname/xxx,name=XXX
For EJBs, you can see similar information in the stats attribute for
jboss.management.local:J2EEServer=local,j2eeType=bean-type,J2EEApplication=ear-file,EJBModule=jar-file,name=ejb-name
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193837#4193837
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193837
15 years, 6 months