[JCA/JBoss] - Trouble with a TCP/SOCKET JCA Resource Adapter
by ameza
Hi all,
I have implemented a JCA Resource Adapter that connect to a C++ legacy application via socket. My problem is that I cannot get my Pool initialized with the proper settings... I am using the -ds.xml file to set the min. and max. for saving some execution time.
(for my -ds.xml file)
<min-pool-size>2</min-pool-size>
<max-pool-size>5</max-pool-size>
Here are my requirements and assumptions for my TCP/SOCKET Connector implementation;
1) each instance of MyConnection class needs to connect to a separate process listening on a different TCP/IP port.
connection-#1 --> localhost:12001
connection-#2 --> localhost:12002
connection-#3 --> localhost:12003
2) I am not using authentication since the legacy application runs in a secured environment and doesn't supports it !
3) The only difference in my ConnectionRequestInfo objets is the TCP/IP port number as per point #1 above. The ConnectionRequestInfo methods equals() and hashcode() are working properly !
4) I am using <application-managed-security/> in my -ds.xml file. As documented in the WIKI for application managed settings/authentication.
Everything work as it should when I call the MyConnectionFactory.getConnection(port_number) from let say an EJB, but not when the server allocates himself the connection. The server is using the default values from my -ds.xml file, which is normal. So, how can I make sure that every MyManagedConnection and its MyConnection are created with the proper ConnectionRequestInfoImpl data by either me or as part of the server's life cycle ?
Forgot to mention that I have simplify the implementation of MyManagedConnection and do NOT use a Set for collection the Connection. I have choosen to go for a simpler 1 for 1 relationship.
Cheers,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019031#4019031
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019031
19Â years, 2Â months
[JBoss Seam] - Re: Security Auto-Login Question
by fernando_jmt
In the pages.xml add the page configuration for the first page you want to access (usually login.xhtml or home.html) and execute the login before rendering the page.
Somthing like:
| <page view-id="/login.xhtml" action="#{identity.login}">
| <navigation from-action="#{identity.login}">
| <rule if="#{identity.loggedIn}">
| <redirect view-id="/home.xhtml"/>
| </rule>
| </navigation>
| </page>
|
The above example means:
When you are trying to access to the page login.xhtml the identity.login action will be executed (same as pressing the button in the page, but without render anything yet), then your authenticator.authenticate method will be called, then if such method returns true, you will be logged in, and the next lines checks if you are logged in using the rule, and if that is true you can redirect the page you want, in this case it is reirecting the home.xhtml (of course already logged in).
HTH.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019028#4019028
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019028
19Â years, 2Â months
[JBoss Seam] - EntityQuery ajax pagination
by dsmithï¼ nesmi.com
Has anyone gotten EntityQuery to work with AJAX pagination? Right now the only way I can get it to work is by putting the EntityQuery component in CONVERSATION scope.
When it isn't in CONVERSATION scope it will not work properly. I can page forward through the list and back through list. But after I leave the first page I can't ever go back to it using repeated clicks of "Previous Page" or clicking "First Page" Also, I can not access the last page of the list though repeated clicking of "Next Page" or clicking "Last Page"
In both the First Page and Last Page not displaying, I can tell from the debug statements that the query is getting executed with the correct firstResult and returning the correct data. But the page does not update.
I don't see why I'd have to put the EntityQuery into CONVERSATION scope
non working example
components.xml
-------------------
| <framework:entity-query name="testCodeListQuery" ejbql="select c from TestCode c" max-results="5"/>
|
view.xhtml
-------------
| <div id="register"><h:form id="testCodes"
| styleClass="register">
| <h:dataTable id="codeList" var="code" value="#{testCodeList.resultList}">
| <h:column>
| <f:facet name="header">
| <h:outputText value="Code" />
| </f:facet>
| <h:outputText value="#{code.name}"/>
| </h:column>
| <h:column>
| <f:facet name="header">
| <h:outputText value="Desc" />
| </f:facet>
| <h:outputText value="#{code.desc}"/>
| </h:column>
| </h:dataTable>
| <a:commandButton value="First Page" reRender="testCodes" disabled="#{!testCodeList.previousExists}">
| <a:actionparam name="firstResult" value="0"/>
| </a:commandButton>
| <a:commandButton value="Previous Page" reRender="testCodes" disabled="#{!testCodeList.previousExists}">
| <a:actionparam name="firstResult" value="#{testCodeList.previousFirstResult}"/>
| </a:commandButton>
| <a:commandButton value="Next Page" reRender="testCodes" disabled="#{!testCodeList.nextExists}">
| <a:actionparam name="firstResult" value="#{testCodeList.nextFirstResult}"/>
| </a:commandButton>
| <a:commandButton value="Last Page" reRender="testCodes" disabled="#{!testCodeList.nextExists}">
| <a:actionparam name="firstResult" value="#{testCodeList.lastFirstResult}"/>
| </a:commandButton>
|
| </h:form></div>
|
Paging Bean
--------------
| @Name("testCodePaginatior")
| public class TestCodePaginatior implements Serializable {
|
| @Logger
| private Log log;
|
| @In("#{testCodeListQuery}")
| private EntityQuery testCodeListQuery;
|
| @Out
| private EntityQuery testCodeList;
|
| @RequestParameter("firstResult")
| private Integer firstResult;
|
| @Factory("testCodeList")
| public void init() {
| this.testCodeList = testCodeListQuery;
| int index = 0;
| if(this.firstResult != null){
| index = firstResult;
| }
| testCodeList.setFirstResult(index);
| log.debug("paging '#0' with firstResult = '#1'",this.testCodeList, this.firstResult);
| }
| }
|
working example, but conversation scope
Paging Bean
--------------
| @Name("testCodePaginatior")
| public class TestCodePaginatior implements Serializable {
|
| @Logger
| private Log log;
|
| @In("#{testCodeListQuery}")
| private EntityQuery testCodeListQuery;
|
| @In(required=false)(a)Out(scope=ScopeType.CONVERSATION)
| private EntityQuery testCodeList;
|
| @RequestParameter("firstResult")
| private Integer firstResult;
|
| public void page(){
| log.debug("paging '#0' with firstResult = '#1'",this.testCodeList, this.firstResult);
| int index = 0;
| if(this.firstResult != null){
| index = firstResult;
| }
| testCodeList.setFirstResult(index);
| testCodeList.refresh();
| }
|
| @Factory("testCodeList")
| public void init() {
| this.testCodeList = testCodeListQuery;
| int index = 0;
| if(this.firstResult != null){
| index = firstResult;
| }
| testCodeList.setFirstResult(index);
| log.debug("initing '#0' with firstResult = '#1'",this.testCodeList, this.firstResult);
| }
|
view.xhtml
-------------
| <div id="register"><h:form id="testCodes"
| styleClass="register">
| <h:dataTable id="codeList" var="code" value="#{testCodeList.resultList}">
| <h:column>
| <f:facet name="header">
| <h:outputText value="Code" />
| </f:facet>
| <h:outputText value="#{code.name}"/>
| </h:column>
| <h:column>
| <f:facet name="header">
| <h:outputText value="Desc" />
| </f:facet>
| <h:outputText value="#{code.desc}"/>
| </h:column>
| </h:dataTable>
|
| <a:commandButton value="First Page" action="#{testCodePaginatior.page}" reRender="testCodes" disabled="#{!testCodeList.previousExists}">
| <a:actionparam name="firstResult" value="0"/>
| </a:commandButton>
| <a:commandButton value="Previous Page" action="#{testCodePaginatior.page}" reRender="testCodes" disabled="#{!testCodeList.previousExists}">
| <a:actionparam name="firstResult" value="#{testCodeList.previousFirstResult}"/>
| </a:commandButton>
| <a:commandButton value="Next Page" action="#{testCodePaginatior.page}" reRender="testCodes" disabled="#{!testCodeList.nextExists}">
| <a:actionparam name="firstResult" value="#{testCodeList.nextFirstResult}"/>
| </a:commandButton>
| <a:commandButton value="Last Page" action="#{testCodePaginatior.page}" reRender="testCodes" disabled="#{!testCodeList.nextExists}">
| <a:actionparam name="firstResult" value="#{testCodeList.lastFirstResult}"/>
| </a:commandButton>
|
| </h:form></div>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019024#4019024
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019024
19Â years, 2Â months
[EJB 3.0] - EJB3 deployment and ClassDefNotFound
by pbzdyl
Hello All,
I have following ear application structure:
sample-app.ear
|
| META-INF
| application.xml (cited in the end of this post)
| MANIFEST.MF (containing: Class-Path: sample-logic-api.jar sample-model.jar sample-logic-.jar
|
| sample-model.jar
| net.bzdyl.sample.model.Customer (simple entity with @Entity)
|
| sample-logic-api.jar
| net.bzdyl.sample.logic.CustomerManager (simple interface with create/update/delete/query methods, no annotations)
|
| sample-logic-impl.jar
| META-INF
| persistence.xml (cited in the end of this post)
| MANIFEST.MF (containig: Class-Path: sample-logic-api-.jar sample-model.jar
| net.bzdyl.sample.logic.CustomerManagerBean (with @Remote(CustomerManager.class) @Stateless annotations)
|
When I am deploying it on JBoss 4.0.5.GA (with EARDeployer configured with Isolated=true) it is working fine. But when I am installing it on JBoss 5.0.0.Beta1 (default configuration) I am getting
21:24:37,891 ERROR [EJBRegistrationDeployer] Error during deployment: jar:file:/
C:/dev/java/jboss-5.0.0.Beta1/server/default/deploy/sample-app.ear!/
sample-logic-impl.jar
java.lang.NoClassDefFoundError: net/bzdyl/sample/logic/CustomerManager
during deployment process. Why?
Thanks,
Piotrek
application.xml
<?xml version="1.0" encoding="UTF-8"?>
| <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
| <description>Sample application</description>
| <display-name>sample-ear</display-name>
| <module>
| <ejb>sample-logic-impl-.jar</ejb>
| </module>
| </application>
|
persistence.xml
<persistence>
| <persistence-unit name="SamplePU">
| <jta-data-source>java:/DefaultDS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| <property name="hibernate.show_sql" value="true"/>
| </properties>
| <class>net.bzdyl.sample.model.Customer</class>
| </persistence-unit>
| </persistence>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019018#4019018
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019018
19Â years, 2Â months
[JBoss Eclipse IDE (users)] - ear deployment.
by jdijkmeijer
Hi I'm currently trying to get a seam project going as a j2ee jst/wtp project on eclipse. It looks promising, I can cook my ear (via export) but publishing the thing on the server gives a server error can't find module jboss-seam. Which is declared in the application.xml and present in the root of the ear project, but not at the root of ear.
I see the jboss323.xml is executed but the ear wich is used doesnt have the jars inside.
apparantly the ear target is bundling the files at a designated directory,
D:/projects/seamice/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/spuytear
but looking at that directory I think that the libs are not present in there. I havent been able to figure out where they are coming from.
I apologize I this is the wrong forum, I'm a bit mystified by the many project acronyms jst/wst/wtp/jboss-ide etc. But I hope somebody can help me.
regards,
Jeroen.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019015#4019015
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019015
19Â years, 2Â months
[JBoss Seam] - Security Auto-Login Question
by craig.barkerï¼ cmm-group.com
Hi All,
I've got a bit of a beginners question I've been struggling with for a few days now. I'm trying to use the new (1.1.6) security features and I must say they are very simple and powerful, great job.
Unfortunately all examples i've seen so far assume that a user will login to the session with a username/password and then hit the #{identity.login} button/link.
In my situation I've implemented single sign-on using NTLM authentication against windows credentials, and it works fine. The problem is i'm not sure how to execute the #{identity.login} without the user having to do anything!
Here's my authenticate object.
@Name("authenticator")
| public class Authenticator
| {
| @In Context sessionContext;
|
| @PersistenceContext(unitName="izzyDS")
| private EntityManager em;
|
| public boolean authenticate()
| {
| Identity.instance().setUsername(((NtlmPasswordAuthentication) sessionContext.get("NtlmHttpAuth")).getUsername());
| try
| {
| User user = (User) em.createQuery(
| "from User where username = :username")
| .setParameter("username", Identity.instance().getUsername())
| .getSingleResult();
|
| for (Object mem : user.getMemberships())
| {
| Identity.instance().addRole(((Membership)mem).getRole());
| }
|
| return true;
| }
| catch (NoResultException ex)
| {
| return false;
| }
| }
|
| }
I'm quite flexible about the final page configuration and am running the packaged version of facelets and icefaces 1.5.3 if that helps.
I'm abit embarrassed as i've done all the difficult work and I just need this last (seemingly simple) step to get it all polished.
Many thanks in advance,
Craig
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019009#4019009
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019009
19Â years, 2Â months