[JBoss/Spring Integration] - jboss-spring.xml beans location
by loumaus
Hi there ..
am trying to deploy a formerly created spring application into jboss ( spring deployer properly installed )
my spring app covers its own bean definitions ...
in order to keep them at a single location i simply added a
definition to the jboss-spring.xml.
The server log reveals that the application is loading my beans properly. Accessing them during runtime from within an ejb using @Spring leads to a nullpointer exception. Analyzing this fact led me to the following problem:
DEBUG [org.jboss.spring.interceptor.SpringInjectionInterceptor] Injecting bean 'catalogService' of class type $Proxy168 into foo.bar.ejb.DefaultCatalogServiceStateless@ce4dda v
ia private foo.bar.service.CatalogService foo.bar.ejb.DefaultCatalogServiceStateless.catalogService
Placing the catalogBean directly into the jboss-spring.xml solves the upper mentioned problem.
2007-07-05 16:41:01,664 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Returning cached instance of singleton bean 'catalogService'
2007-07-05 16:41:01,664 DEBUG [org.jboss.spring.interceptor.SpringInjectionInterceptor] Injecting bean 'catalogService' of class type foo.bar.service.DefaultCatalogService into foo.bar.ejb.De
faultCatalogServiceStateless@6fa22b via private foo.bar.service.CatalogService foo.bar..ejb.DefaultCatalogServiceStateless.catalogService
Any idea why this happens ???
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060858#4060858
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060858
18Â years, 9Â months
[JBossCache] - Re: 2.0 and JMX
by nnnnn
A couple of things:
It would be a good idea if this were documented. The 2.0 documentation still implies that no registration is necessary for JMX.
Second, anybody have quick hints (or links) for a JMX newbie? I'm not really interested in learning so much about it right now - I just want to be able to use jconsole to check the state of jbosscache 2.0 in a standalone app.... Particularly, in the code snippets in the thread, I don't know how to get the mbean server or what the monitor name should be (I've figured out that there's an MBeanServerFactory and I can create or get an mbean server from that, I'm not sure whether I should create one or get one, and how the names relate).
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060856#4060856
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060856
18Â years, 9Â months
[Security & JAAS/JBoss] - Re: JAAS, login configuration + Hi everybody
by purbano
Hello, Wolfgang, thanks again for your help.
First of all, I must say that it is not *my* login module, that is, I have not written the application, nor I have access to the people who wrote it. I am only migrating it from oc4j.
Once said that, the login module is not a subclass of the module you said, but a class that doesn't extends anyother, and implements LoginModule.
I'm quite confused with the security-domain thing. I thought it was necessary if applied to EJB. I'll try to do a bit more research before tonight.
Pablo J.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060849#4060849
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060849
18Â years, 9Â months
[Security & JAAS/JBoss] - Re: Cross domain links
by tmarafon
OK...
the documentation wasn't updated..
It was missing the router declaration...
The complete context.xml must be like:
<?xml version="1.0"?>
| <Context>
| <!-- a federation routing valve -->
| <!--
| This valve eliminates the need for cross domain federation links
| to be of the form /federate?target={some link in the other domain}
| With this link, your link can be straight to the resource in the
| other domain
| -->
| <Valve className="org.jboss.security.valve.SSOFederationRouter"/>
| <!--
| logoutURL - URL for performing logout/signout function in your application
| -->
| <Valve className="org.jboss.security.valve.SSOAutoLogout"
| logoutURL="logoff.jsp" />
|
| <!--
| assertingParty - this is the partnerId of this application as a part of a federation of multiple partner sites
| -->
| <Valve className="org.jboss.security.valve.SSOTokenManager"
| assertingParty="SEG" />
|
| <!--
| tomcat built-in AuthenticationTypes: FORM,BASIC,DIGEST,CLIENT-CERT
| -->
| <Valve className="org.jboss.security.valve.SSOAutoLogin"
| authType="FORM" />
| </Context>
|
Thiago
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060843#4060843
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060843
18Â years, 9Â months
[Tomcat, HTTPD, Servlets & JSP] - Custom tag - Jasper compilation error
by ybh6336
Hello all,
I am trying to use a simple custom tag in my JSP that sets an attribute on the page. This JSP works fine on both WebLogic and WebSphere, but gives the following compilation error on JBoss:
| <org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/].[jsp]> - <Servlet.service() for servlet jsp threw exception>
| org.apache.jasper.JasperException: Unable to compile class for JSP
|
| An error occurred at line: 125 in the jsp file: /test/jsp/testCustomTag.jsp
| Generated servlet error:
| pageVar cannot be resolved
|
| at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
| at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
| at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
| at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
| at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
| at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
| at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
| at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
| at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
| at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| ...
| ...
|
The code fragment in the JSP looks as follows:
| <util:myCustomTag
| id="pageVar"
| attr1="<% attr1 %>"
| attr2="<%= attr2 %>"
| attr3="<%= attr3 %>"
| >
|
| <%
| String pageVar2 = pageVar;
| %>
|
And the tag definition in .tld is as follows:
| ...
| ...
| <tag>
| <name>myCustomTag</name>
| <tag-class>com.test.MyCustomTag</tag-class>
| <body-content>JSP</body-content>
| <description>
| Just a test tag
| </description>
| <variable>
| <name-from-attribute>id</name-from-attribute>
| <variable-class>String</variable-class>
| <declare>true</declare>
| <scope>AT_END</scope>
| </variable>
| <attribute>
| <name>id</name>
| <required>true</required>
| <rtexprvalue>false</rtexprvalue>
| </attribute>
| <attribute>
| <name>attr1</name>
| <required>true</required>
| <rtexprvalue>true</rtexprvalue>
| </attribute>
| <attribute>
| <name>attr2</name>
| <required>true</required>
| <rtexprvalue>true</rtexprvalue>
| </attribute>
| <attribute>
| <name>attr3</name>
| <required>true</required>
| <rtexprvalue>true</rtexprvalue>
| </attribute>
| <attribute>
| <name>attr4</name>
| <required>false</required>
| <rtexprvalue>true</rtexprvalue>
| </attribute>
| </tag>
| ...
| ...
|
I enabled 1.5 features by uncommenting the following in deploy\jbossweb-tomcat55.sar\conf\web.xml:
| <init-param>
| <param-name>compilerSourceVM</param-name>
| <param-value>1.5</param-value>
| </init-param>
|
Environment:
- JBoss 4.0.5 GA
- BEA JDK 1.5.0_04
- Windows XP
NOTE - The code fragment above is in a JSP that is an include in another JSP, and <%@ taglib uri="/taglib.tld" prefix="util"%> is declared in the parent JSP. The JSP has been included using the following:
| <%@ include file="/test/jsp/testCustomTag.jsp" %>
|
Is there a JSP specs violation in this code somewhere? I would appreciate any feedback.
Regards.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060838#4060838
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060838
18Â years, 9Â months
[JBoss Seam] - Re: problem with conversations
by Kruno
I was a bit lost in your example:
here is on of mine :
pages.xml:
|
| <page view-id="/page.jsp" >
| <begin-conversation join="true"/>
| </page>
|
RegisterAction
| package orka.test;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
|
| @Stateful
| @Scope(ScopeType.CONVERSATION)
| @Name("register")
| public class RegisterAction implements Register {
|
| @PersistenceContext
| private EntityManager em;
|
| @In
| User user;
|
|
| public String reg(){
| System.err.println(user.getName());
| // check for errors
| // then persist
| //em.persist(user);
|
| return "ok";
|
| }
| @Remove @Destroy
| public void destroy(){
|
| }
|
| }
|
user class I belive that this is much better way if you divide data form actions
| package orka.test;
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
|
| // make him an entity so you can persist him
| @Name("user")
| @Scope(ScopeType.CONVERSATION)
| public class User {
|
| private String name;
|
| public String getName() {
| return name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
|
|
|
| }
|
and jsp page
|
| <%@ page contentType="text/html; charset=UTF-8" %>
| <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
| <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
| <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s"%>
|
|
| <f:view>
| <h:form id="forma">
|
| <h:inputText value="#{user.name}"></h:inputText>
|
| <h:commandButton action="#{register.reg}" value="register" />
|
|
|
| </h:form>
| </f:view>
|
every time you come to page it will be a new conversation because user entity is conversation scope and it is empty, but when you submit it is not new conversation. I think that is what you want
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060837#4060837
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060837
18Â years, 9Â months