[Clustering/JBoss] - Re: ejb3 SFSB with load-balancing but without replication
by bstansberry@jboss.com
You can set the CacheMode attribute in ejb3-clustered-sfsbcache-service.xml to LOCAL and that will disable replication. That will affect all EJB3 SFSBs though.
The org.jboss.annotation.ejb3.cache.tree.CacheConfig annotation has a name attribute which allows you to specify the ObjectName of the JBoss Cache instance. You could set up a separate cache, similar to ejb3-clustered-sfsbcache-service.xml but with CacheMode LOCAL. Then use the CacheConfig annotation on your beans to specify the use of that cache.
Haven't tried the 2nd paragraph, but should work.
Hmm. You'd also need to remove the cache loader and the eviction configuration from the cache, or it will try to serialize your bean for passivation. You thus lose the ability to passivate your bean.
It's also possible to do standard serialization tricks like making certain field transient, etc.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005829#4005829
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005829
19 years, 3 months
[JBoss Seam] - Re: iText (PDF) support in Seam
by rbz285
I've tried out the latest (3 hours ago) version from cvs and it works well for me. I used the servlet version so it gives me a url with my.pdf in it (once I remembered to put the useExtensions value in components.xml).
I tried my generic table again (thanks for the value binding on the widths property) but it still needs a value binding on the columns property before it'll work. I tested the concept by quickly subclassing the UITable tag to do it and it again works well (as does the landscape mode)
I've just voted for http://jira.jboss.com/jira/browse/JBSEAM-680 for the formatting of values.
I've got one other request, I'd like to be able to have headers and footers on the first page as well as all the others.
On the NPE reported by m.schuetz above, I can also get it whenever the PDF doesn't exist in the store, which can happen if the user hasn't logged in, manually types the url, or if there was just an error in the xhtml so the generation failed. Not sure the best thing for it to do in these cases, maybe send a 404 ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005828#4005828
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005828
19 years, 3 months
[JBossCache] - Clearing cache contents in JBoss using GUI
by suman291857
Hello,
Can anyone advise me how to clear cache using JMX Mbeans.This is the xml file which iam loading
<?xml version="1.0" encoding="UTF-8" ?>
| <server>
| <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
|
| <!-- ==================================================================== -->
| <!-- Defines TreeCache configuration -->
| <!-- ==================================================================== -->
| <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=CustomTreeCache">
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
|
|
| <!-- Configure the TransactionManager -->
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
|
| <!--
| Node locking level : SERIALIZABLE
| REPEATABLE_READ (default)
| READ_COMMITTED
| READ_UNCOMMITTED
| NONE
| -->
| <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
|
| <!-- Valid modes are LOCAL
| REPL_ASYNC
| REPL_SYNC
| -->
| <attribute name="CacheMode">LOCAL</attribute>
|
|
| <!-- The max amount of time (in milliseconds) we wait until the
| initial state (ie. the contents of the cache) are retrieved from
| existing members in a clustered environment
| -->
| <attribute name="InitialStateRetrievalTimeout">5000</attribute>
|
|
|
| <!-- Number of milliseconds to wait until all responses for a
| synchronous call have been received.
| -->
| <attribute name="SyncReplTimeout">10000</attribute>
|
| <!-- Max number of milliseconds to wait for a lock acquisition -->
| <attribute name="LockAcquisitionTimeout">15000</attribute>
|
|
|
| </mbean>
| <mbean code="org.jboss.cache.TreeCacheView" name="jboss.cache:service=TreeCacheView">
| <depends>jboss.cache:service=CustomTreeCache</depends>
| <attribute name="CacheService">jboss.cache:service=CustomTreeCache</attribute>
| </mbean>
| </server>
|
And i have TreeCacheGUI from the JMX console.Even on deleting the Node from TreeCacheGUI ,my code still seems to pick up the old cache contents.
Hers the code snippet
|
| ClassPathXmlApplicationContext context = ApplicationContextSingleton.getSpringApplicationContext();
| TreeCacheMBean cacheObj = (TreeCacheMBean)context.getBean(CACHE_SPRING_BEAN_NAME);
| (List<Offer>)cacheObj.get(path, key);
|
Can anyone kindly advise?
Many Thanks
Prashanth
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005824#4005824
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005824
19 years, 3 months
[JBoss Seam] - Re: Using Jasper Reports with Seam/JBoss
by squibobblepants
hmm. I think the transaction exception is a bit of a red herring - it seems to appear at the bottom of all stack traces now.
I'm getting the same error now even when trying to access a simple string in my reporting bean:
reporting.java:
| @Stateful
| @Name("reporting")
| @Scope(ScopeType.SESSION)
| public class ReportManager implements ReportManagerI {
|
| ...
|
| @Out
| public String hello="hello";
|
| ...
| }
|
reporting.xhtml:
| ...
|
| <h:outputText value="#{reporting.hello}" />
|
| ...
|
Is also giving me:
| javax.faces.el.PropertyNotFoundException: /reporting.xhtml @37,53 value="#{reporting.hello}": Bean: org.jboss.seam.intercept.Proxy$$EnhancerByCGLIB$$3196fd0, property: hello
| at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:58)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:217)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:69)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:57)
|
I think maybe there's something wrong with my bean?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005822#4005822
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005822
19 years, 3 months
[EJB/JBoss] - Strange problem
by earniedyke
Greetings,
I have a strange problem I hope someone can help me with. I have a java app that runs on a server separate from my JBoss 4.0.1sp1 instance. This app connects and tries to get a stateless EJB from JBoss. The lookup works fine but when I do home.create the method ends without an exception. It just right to the finally method without executing any code after the create. Anyone run into this before?
Thanks in advance for any and all help.
Earnie!
package com.vrs.selfserv.batch;
|
| import java.rmi.RMISecurityManager;
| import java.util.*;
|
| import javax.naming.InitialContext;
| import javax.rmi.PortableRemoteObject;
| import javax.mail.*;
| import javax.mail.internet.*;
|
| import org.apache.log4j.Logger;
|
| import com.vrs.selfserv.session.interfaces.RegistrarEr;
| import com.vrs.selfserv.session.interfaces.RegistrarErHome;
| import com.vrs.selfserv.dataobject.RegistrationErReportUnregisteredUsers;
| import com.vrs.selfserv.dataobject.RegistrationErReportTerminatedUsers;
| import com.vrs.selfserv.dataobject.RegistrationErReportNewUsers;
| import com.vrs.selfserv.dataobject.RegistrationErReportDetail;
|
| public class BatchEmployerRegistrationProcessor {
|
| private static final String EJB_NAME = "ejb/RegistrarErRemoteHome";
|
| private InitialContext ic = null;
|
| private RegistrarErHome home = null;
|
| private RegistrarEr registrar = null;
|
| private Properties props = null;
|
| private static Logger log = null;
|
| private BatchEmployerRegistrationProcessor() {
| /*
| * Log properties are read automatically from log4j.xml
| */
| log = Logger.getLogger(this.getClass());
| log.info("Processing begins");
| }
|
| /**
| * @param args
| */
| public static void main(String[] args) {
| BatchEmployerRegistrationProcessor processor = new BatchEmployerRegistrationProcessor();
| int exitCode = 0;
| try {
| processor.init();
| processor.process();
| } catch (Exception e) {
| exitCode = 32;
| } finally {
| if (exitCode == 0) {
| log.info("Processing ends");
| } else {
| log.warn("Processing terminated");
| }
| System.exit(exitCode);
| }
| }
|
| private void init() throws Exception {
| log.debug("Initializing");
| try {
| /*
| * Load runtime properties. JNDI properties are read automatically from
| * jndi.properties
| */
| props = new Properties();
| props.load(this.getClass().getResourceAsStream("/run.properties"));
| ic = new InitialContext();
| Hashtable env = ic.getEnvironment();
| if (log.isDebugEnabled()) {
| for (Iterator it = env.keySet().iterator(); it.hasNext();) {
| String key = (String) it.next();
| log.debug("Property: " + key + "=" + env.get(key));
| }
| }
| log.debug("Creating security manager");
| System.setSecurityManager(new RMISecurityManager());
| log.debug("Security Manager set");
| Object objref = ic.lookup(EJB_NAME);
| log.debug("Lookup of EJB complete");
| home = (RegistrarErHome) PortableRemoteObject.narrow(objref, RegistrarErHome.class);
| log.debug("EJB home has been narrowed " + (home == null ? " home is null" : home.getClass().getName()));
| registrar = home.create();
| log.debug("EJB home created");
| } catch (Exception e) {
| log.debug("Oops! " + e.getMessage());
| log.error("Initialization error", e);
| System.out.println(e.getMessage());
| e.printStackTrace();
| throw e;
| }
| log.debug("Initialization complete");
| }
|
| private void process() throws Exception {
| try {
| log.debug("Getting list of authorized users");
| List authorizedUsers = registrar.getAuthorizedUsers();
| log.debug(authorizedUsers.size() + " authorized users retrieved");
|
| log.debug("Getting list of active registrations");
| List activeUsers = registrar.getActiveRegistrations();
| log.debug(activeUsers.size() + " active registrations retrieved");
|
| log.debug("Getting list of users who have not registered");
| List pendingUsers = registrar.getPendingRegistrations();
| log.debug(pendingUsers.size() + " non-registered users retrieved");
|
| /* other code removed that is not pertinent to the problem */
|
| } catch (Exception e) {
| log.error("Processing exception", e);
| emailMessage.append("<hr><span style=\"color:red);\">ERROR</span><br/>");
| emailMessage.append("Processing exception: ");
| emailMessage.append(e.toString());
| sendMailTo = 'I';
| } finally {
| log.info("Transaction processing complete");
| emailMessage.append("</body></html>");
| log.debug(emailMessage);
| sendEmail(emailMessage, sendMailTo);
| }
| }
|
| private void sendEmail(StringBuffer emailMessage, char to) {
| /* code removed that is not pertinent */
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005821#4005821
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005821
19 years, 3 months