[JBoss Seam] - Re: Hibernate SessionFactory in Seam App?
by PatrickMadden
Hi, I'm getting a exception as follows when trying to do as you described. I must have something else wrong unfortunately.
anonymous wrote : javax.naming.NameNotFoundException: EntityManagerFactory not bound
I've wrapped my servlet with SeamServletFilter as follows in web.xml
| <!-- propogate seam context to servlets (pvm) addition -->
| <filter>
| <filter-name>Seam Servlet Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamServletFilter</filter-class>
| </filter>
| <filter-mapping>
| <filter-name>Seam Servlet Filter</filter-name>
| <url-pattern>/servlet/*</url-pattern>
| </filter-mapping>
| <!-- end seam context to servlets -->
|
And for my verify user servlet mapping I have the following
| <servlet>
| <servlet-name>VerifyUser</servlet-name>
| <servlet-class>
| com.clooster.web.servlet.VerifyUser
| </servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>VerifyUser</servlet-name>
| <url-pattern>/servlet/VerifyUser</url-pattern>
| </servlet-mapping>
|
Inside my servlet I have an API to get the EntityManager as follows:
| protected EntityManager getEntityManager() throws NamingException
| {
| EntityManagerFactory factory = (EntityManagerFactory)
| Naming.getInitialContext().lookup("java:/EntityManagerFactory");
|
| EntityManager em = factory.createEntityManager();
|
| return em;
| }
|
Calling the above method results in the NameNotFoundException.
One another note, once I have the above problem solved - what is the prescribed way to redirect a user to a property seam page. I'm going to attempt to do the following - will it work?
| EntityManager em = this.getEntityManager();
|
| ClUsers user = em.find(ClUsers.class, greeter.getName());
|
| if (user != null)
| {
| // ok we have verified that this user's email address is valid
| // and he/she is whom they say they are - set the status
| // in the db and commit for this user.
|
| user.setStatus((short) 1);
|
| em.persist(user);
|
| // now login the user
| LoginAction loginAction = (LoginAction) Component.getInstance(LoginAction.class);
| Contexts.getSessionContext().set("greeter", greeter);
| loginAction.login();
| }
| else
| {
| response.getOutputStream().println(
| "Invalid User");
| }
|
Or should I be using the HttpServletResponse.enodeRedirectURL API?
Again, thank you for your great work!
PVM
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995623#3995623
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995623
19 years, 7 months
[JBoss Seam] - problem using the pages.xml to call action method?
by FredF
Hello all.
I am having problem using the action attribute in the page element in the file pages.xml.
I have a view-file which has a form and a datatable element.
I want to populate this datatable with data from a seam component when the user loads the page, not in the response of the form submit.
I have defined a method initAllMessages that populates my list (my list has @Out @DataModel) with data
and I use that list in the datatable
<h:dataTable value="#{allMessages}" var="message">
| <h:column>
| <h:outputText value="#{message.text}" />
| </h:column>
| </h:dataTable>
I instruct seam to call the initAllData with the action parameter
in a page element in pages.xml like this:
<pages>
| <page view-id="/input.jsp" action="#{post.initAllMessages}" />
| </pages>
The problem is that I get an exception:
2006-12-21 10:42:39,640 ERROR [org.jboss.portal.portlet.container.org_apache_myfaces_portlet_MyFacesGenericPortlet] The portlet threw an exception
javax.faces.el.EvaluationException: Exception while invoking expression #{post.initAllMessages}
The class in where I define my method to call implements an interface, has conversation scope and the Name annotation. The method it self has the @Create annotation
The seam view-file is loaded in a portlet contained in JBoss Portal.
Why am I getting this exception when seam tries to call the method?
Is there better/another way to populate data in a datatable on a non-faces get request?
thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995620#3995620
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995620
19 years, 7 months
[JBoss Seam] - Design question
by enesterov
Hi everyone,
First of all I love Seam. So far we've built one application of the medium complexity and experience is very positive.
We have pretty large legacy application which needs to be brought to the new technology with certain improvements. I can see how most of it could be implemented using Seam. There is though one module which is completely meta data driven. We have a set of dynamic forms which have variable number of controls. Controls' name get there names assigned at runtime based on a couple of factors: user role, product category, etc.
The question is how one can capture the data from like this in non ugly way? Is there a way to implement this is Seam?
I appreciate your attention and ideas.
Thanks,
Ed
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995612#3995612
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995612
19 years, 7 months
[JBoss Messaging] - 1.2.0beta1 with JEMS 1.2.0CR1 fails
by Juergen.Zimmermann
After installing JBoss Messaging using "ant -f release-admin.xml" I tried to start the JBoss server using "run -c messaging". However, I get the following stack trace. Any hint is appreciated!
...
| 2006-12-21 15:14:17,347 INFO [org.jboss.remoting.transport.socket.SocketServerInvoker] Invoker started for locator: InvokerLocator [socket://127.0.0.1:3873/]
| 2006-12-21 15:14:23,476 ERROR [org.jboss.deployment.MainDeployer] Could not create deployment: file:/C:/Programme/jboss/server/messaging/deploy/jboss-messaging.sar/postgresql-persistence-service.xml
| org.jboss.deployment.DeploymentException: org.jboss.messaging.core.plugin.JDBCPersistenceManager.<init>(); - nested throwable: (java.lang.NoSuchMethodException: org.jboss.messaging.core.plugin.JDBCPersistenceManager.<init>())
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
| at org.jboss.system.ServiceController.install(ServiceController.java:226)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.install(Unknown Source)
| at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:959)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy6.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:490)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.NoSuchMethodException: org.jboss.messaging.core.plugin.JDBCPersistenceManager.<init>()
| at java.lang.Class.getConstructor0(Class.java:2678)
| at java.lang.Class.getConstructor(Class.java:1629)
| at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:1232)
| at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:286)
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:193)
| at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:449)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
| ... 84 more
| 2006-12-21 15:14:27,532 INFO [org.jboss.ws.server.ServiceEndpointManager] jbossws-1.0.4.GA (date=200611151648)
| ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995606#3995606
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995606
19 years, 7 months
[Messaging, JMS & JBossMQ] - Problem with createTopicConnection - over http proxy server
by alexz75
Hi All!
I tried find any solution for follow issue during migration to HTTP lookups:
1. We have JBOSS 4.0.5GA server installed in our local network.
2. We successfully work with EJB beans locally and remotely
3. We have no problem to work with JMS locally
But...
createTopic throws exception (see below).
I've found source of this problem usage of ipaddress in url: http://145.9.239.153:8080/jbossmq-httpil/HTTPServerILServlet
Because java not able to detect - this ip address is local and can't be accessed thru gateway.
We have workaround - put specific ip address into list of bypass adresses, but it seems ugly, we have couple of remote servers, that should be accessed thru gateway.
How we can force client usage of URL instead of ip?
(jndi.properties have full qualified name of server host)
| jndiContext = m_ctx;
| ref = (TopicConnectionFactory) jndiContext.lookup("HTTPConnectionFactory");
| m_topic = (Topic)jndiContext.lookup(LMProperties.sTOPIC_PATH);
| // here it hangs for 2 mins and throw exception:
| m_topic_connection = ref.createTopicConnection();
|
Exception:
| Cannot authenticate user; - nested throwable: (java.io.IOException: Server returned HTTP response code: 504 for URL: http://145.9.239.153:8080/jbossmq-httpil/HTTPServerILServlet)
| javawsApplicationMain|org.jboss.mq.SpyJMSException.getAsJMSException(SpyJMSException.java:72)
| org.jboss.mq.SpyJMSException.rethrowAsJMSException(SpyJMSException.java:57)
| org.jboss.mq.Connection.authenticate(Connection.java:1069)
| org.jboss.mq.Connection.<init>(Connection.java:252)
| org.jboss.mq.Connection.<init>(Connection.java:323)
| org.jboss.mq.SpyConnection.<init>(SpyConnection.java:116)
| org.jboss.mq.SpyConnectionFactory.internalCreateConnection(SpyConnectionFactory.java:137)
| org.jboss.mq.SpyConnectionFactory.createTopicConnection(SpyConnectionFactory.java:118)
|
Glad to get any suggestions...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995603#3995603
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995603
19 years, 7 months
[JBoss Messaging] - JBoss doesnt release threads after executing MDB (out of Mem
by suhail
Hi,
I am using JBoss AS jboss-4.0.2.
I am getting OutOfMemoryError when I send the messages to an MDB. It happens after i send 30-40 messages. What I have observed on the web-console of Jboss is that #Threads increases by some 30 whenever I sent one message to a queue. Even though message is getting consumed instantly, the thread count doesn?t come down but keep on increasing by a factor of approx 30 or more with each message. After sometime it reaches some 2000 figure and server starts giving out of memory error. If I make process synchronous (I mean not use MDB) , thread count doesnt increase.
It implies that each message is adding approx. 30 threads and threads are not released after messages are getting consumed. Can anybody explain it and give a fix ?
Please find the stack of errors below. I get either of these two stacks.
Any help will be appreciated.
Thank you
Suhail
20 Dec 2006 16:20:10,176 WARN (UILServerILService Accept Thread:) [org.jboss.mq.il.uil2.UILServerILService] Unexpected error in setup of client connection
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:574)
at org.jboss.mq.il.uil2.SocketManager.start(SocketManager.java:147)
at org.jboss.mq.il.uil2.UILServerILService.run(UILServerILService.java:162)
at java.lang.Thread.run(Thread.java:595)
20 Dec 2006 13:18:35,031 ERROR (TimeoutFactory-0:) [org.jboss.logging.Log4jService$ThrowableListenerLoggingAdapter] Unhandled Throwable
org.jboss.util.threadpool.ThreadPoolFullException: java.lang.OutOfMemoryError: unable to create new native thread
at org.jboss.util.threadpool.BasicThreadPool.execute(BasicThreadPool.java:417)
at org.jboss.util.threadpool.BasicThreadPool.runTaskWrapper(BasicThreadPool.java:192)
at org.jboss.util.threadpool.BasicThreadPool.run(BasicThreadPool.java:212)
at org.jboss.util.threadpool.BasicThreadPool.run(BasicThreadPool.java:206)
at org.jboss.util.timeout.TimeoutFactory.doWork(TimeoutFactory.java:223)
at org.jboss.util.timeout.TimeoutFactory.access$000(TimeoutFactory.java:41)
at org.jboss.util.timeout.TimeoutFactory$1.run(TimeoutFactory.java:136)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995601#3995601
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995601
19 years, 7 months
[Installation, Configuration & Deployment] - auth-method FORM ? realm-name ? JBoss-4.0.5GA, what i missed
by WatchCat
HELP PLS!
I don't know where to search for the decision of my problem.
There is some application that use FORM authentication method.
These are fragments of config-files.
login-config.xml:
| <policy>
| ...
| <application-policy name="MyDomain">
| <authentication>
| <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
| <module-option name = "unauthenticatedIdentity">guest</module-option>
| <module-option name = "dsJndiName">java:/PostgreDS</module-option>
| <module-option name = "principalsQuery">SELECT PASSWD FROM SYS_USERS WHERE USERID=?</module-option>
| <module-option name = "rolesQuery">SELECT ROLEID, 'Roles' FROM SYS_ROLES WHERE USERID=?</module-option>
| </login-module>
| </authentication>
| </application-policy>
| </policy>
|
web.xml:
| ...
| <login-config>
| <auth-method>FORM</auth-method>
| <realm-name>MyDomain<realm-name>
| <form-login-config>
| <form-login-page>/LoginForm.jsp</form-login-page>
| <form-error-page>/LoginForm.jsp</form-error-page>
| </form-login-config>
| </login-config>
| ...
|
jboss-web.xml:
| <jboss-web>
| <security-domain>java:/jaas/MyDomain</security-domain>
| </jboss-web>
|
but when i try open application in browser, in log file appears this message:
| ...
| 00:00:27,890 ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files
| java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
| at org.jboss.security.auth.spi.Util.loadProperties(Util.java:315)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)
| at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)
| ...
| 00:00:27,890 ERROR [AuthenticationManager] Couldn't log in.
| Message=Missing users.properties file.
|
And i can'nt perform login in my application.
Whence has appeared UsersRolesLoginModule, if I specified DatabaseServerLoginModule?
What i missed?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995594#3995594
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995594
19 years, 7 months
[JNDI/Naming/Network] - Global environment entries
by crnflke
I'm trying to get some form of global environment entry so that it can be seen in JNDI by everybody.
We want a series of bits of information to be stored that will be different depending on whether the server is in a dev/test environment and a live environment. In Tomcat we used server.xml Environment tags, but this doesn't seem to work in JBoss.
I found the JNDI Binding Manager, but this causes me problems too, as it produces the cryptic error message
ObjectName: jboss.tests:name=example1
State: FAILED
Reason: org.jboss.deployment.DeploymentException: No property editor for attribute: BindingsConfig; type=class org.jboss.naming.JNDIBindings
This is for the example that's in the documentation!
We're using jboss4.0.5 with the EJB3 extensions.
The only other way I can see to attack this problem is something like a custom bit of Java code that does the necessary work, or alternatively storing the properties in a database, but both of them seem like a bit of a waste.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995592#3995592
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995592
19 years, 7 months
[Management, JMX/JBoss] - Re: Listing all EJBs through JMX
by danieldestro
Hi dimitris,
I tried to use twiddle according to the examples (http://docs.jboss.org/jbossas/jboss4guide/r1/html/ch2.chapter.html), but I only got error messages, such as:
C:\jboss-4.0.3SP1\bin>twiddle query 'jboss:service=JNDIView'
| 13:48:38,772 ERROR [Twiddle] Command failure
| org.jboss.console.twiddle.command.CommandException: Unused argument: JNDIView'
| at org.jboss.console.twiddle.command.QueryCommand.processArguments(Query
| Command.java:104)
| at org.jboss.console.twiddle.command.QueryCommand.execute(QueryCommand.j
| ava:119)
| at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:290)
|
or even
C:\jboss-4.0.3SP1\bin>twiddle query '*:j2eeType=EjbModule,*'
| 13:50:26,810 ERROR [Twiddle] Command failure
| org.jboss.console.twiddle.command.CommandException: Unused argument: EjbModule
| at org.jboss.console.twiddle.command.QueryCommand.processArguments(Query
| Command.java:104)
| at org.jboss.console.twiddle.command.QueryCommand.execute(QueryCommand.j
| ava:119)
| at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:290)
I am using JBoss-4.0.3-SP1 and Java 5.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995590#3995590
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995590
19 years, 7 months
[JBoss Seam] - HelloWorld-Ajax with Facelets
by hispeedsurfer
Hello,
running the helloworld4 example with .jsp from JBoss Seam Book was successful.
Here the code:
ManagerAction.java
int MAX_RESULTS_RETURNED = 10;
| String [] popularNames = new String [] {
| "Gavin King", "Thomas Heute", "Michael Yuan",
| "Norman Richards", "Bill Burke", "Marc Fleury"
| };
| public void suggestName (FacesContext context,
| String partialName, CompletionResult result) {
|
| System.out.println("Auto Complete method is called");
|
| int totalNum = 0;
| if (partialName.length() > 0) {
| for (int i=0; i<popularNames.length; i++) {
| if (popularNames.toLowerCase().indexOf(partialName.toLowerCase())!=-1
| && totalNum < MAX_RESULTS_RETURNED) {
|
| result.addItem(popularNames);
| totalNum++;
| }
| }
| } else {
| for (int i=0; i<MAX_RESULTS_RETURNED &&
| i<popularNames.length; i++) {
| result.addItem(popularNames);
| }
| }
|
| }
hello.jsp
<h:form>
|
| <h:panelGrid columns="2">
| <h:outputText value="Your Name" />
| <h:panelGroup>
| <ui:autoComplete
| size="15" id="name"
| completionMethod="#{manager.suggestName}"
| value="#{greeter.name}"
| required="false" />
| <h:message for="name" />
| </h:panelGroup>
Now, when I use Facelets for a similar example with same Bean-Code I receive the Error:
ELException: /hello2.xhtml: Bean: org.jboss.seam.intercept.Proxy$$EnhancerByCGLIB$$73f8c9e7, property: suggestName
11:29:38,603 ERROR [STDERR] 21.12.2006 11:29:38 com.sun.facelets.FaceletViewHandler handleRenderException
| SCHWERWIEGEND: Error Rendering View[/hello2.xhtml]
| javax.el.ELException: /hello2.xhtml: Bean: org.jboss.seam.intercept.Proxy$$EnhancerByCGLIB$$73f8c9e7, property: suggestName
| at com.sun.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:53)
| at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:433)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:419)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:75)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:442)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:216)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:98)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
| at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:619)
|
here the code from hello.xhtml
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| template="layout/template.xhtml"
| xmlns:bp="http://java.sun.com/blueprints/ui/14">
|
| <ui:define name="body">
|
| <h1>hello2</h1>
| <p>Generated form page</p>
|
| <h:messages globalOnly="true" styleClass="message"/>
|
| <h:form id="hello2">
| <div class="dialog">
| <h:panelGrid columns="2">
| <h:outputText value="Your name"/>
| <h:panelGroup>
| <bp:autoComplete
| size="15" id="name"
| completionMethod="#{hello.suggestName}"
| value="#{hello.value}"
| required="false" />
| <h:message for="name"></h:message>
| </h:panelGroup>
| </h:panelGrid></div>
| </h:form>
|
| </ui:define>
|
| </ui:composition>
|
The suggestName method is declared in Hello.java interface and HelloBean.java
What I have ToDo to get this running with Facelets?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995561#3995561
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995561
19 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - Hibernate, fetch-join + order by order problem
by virgo47
Hello
I have normal master-detail table pair where master table has mapping like this (important snippets):
<hibernate-mapping>
| <class name="BE" table="be">
| ...
| <property name="stopTimestamp" type="java.util.Date" column="STOP_TS"
| not-null="false"/>
|
| ...
| <bag name="analysis" cascade="all" order-by="start_ts">
| <key column="be_id"/>
| <one-to-many class="BEAnalysis"/>
| </bag>
| ...
| </class>
| </hibernate-mapping>
So I have analyzes ordered by their start_ts column. Now we need process big portion of BEs along with their analysis and we used fetch join in order to do it quickly (lazy load was unacceptably slow - too many selects).
Code for listing those BE with analysis.
Criteria criteria = session.createCriteria(BE.class);
| ...
| criteria.addOrder(Order.asc("stopTimestamp"));
| criteria.setFetchMode("analysis", FetchMode.JOIN);
| return (Collection<BE>) criteria.list();
And now tail of the generated SQL:
... order by analysis2_.start_ts, this_.STOP_TS asc
(this_ is be table of course)
Problem is that I need to order by stop_ts first (be order is much more important, than comes the order of related analysis). What's the cure for this? Thanks for hint
Virgo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995557#3995557
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995557
19 years, 7 months
[JBoss Eclipse IDE (users)] - Re: How contribute to Freemarker plugin and add my Plugin ec
by azerr
anonymous wrote : Yes, I received it; but please send it as a *patch*.
That's done.
anonymous wrote : You only need the java classes in your project if you haven't specified all the types of your mapping files. e.g. when you generate pojo's you just need the mapping files - no classes; otherwise hbm2java could not be possible.
Sorry, I have not seen.
anonymous wrote : We don't have those implemented (except "bean), but nothing in the tools prevents it.
Is it easy to change default architecture (bean) with another architecture? With Akrogen you can create your own Project (MyJ2EE project) and add it component, wizard, for your architecture.
anonymous wrote : I don't get your "bulk" argument here ? Hibernate tools defaults to generate for all entities and components but that can of course be controlled by the exporter if you want to.....and adding a "generate only *this* part" is of course possilbe....
My explanation was not enough good. Imagine you want create finder DAO
with specific criteria (findByCountryId). With Akrogen you can create XML component which generate this method. For this, you must create a template (XSL, Freemarker), and create a XML component MyComponent (parameters IN criteria => XML => display list of your hbm property into the list checkable).
When you select the hbm (menu AKROGE->Components->MyComponent) , the XML component will display a Wizard page, with all property of your hbm. you check Id property and click finish, your DAO findByCountryId will be generated.
anonymous wrote : tip: If you want users to understand Akrogen features you should try and document it with some better examples, the current page is very sparse on information.
I agree with you my documentation is very bad. I have a lot of development for Akrogen (ex : I work to export Freemarker Plugin context .freemarker-ide.xml and build auomaticly Akrogen XML component).
I'm searching people to help me to develop Akrogen and write documentation, but it's very difficult.
Thank you for your answer.
Angelo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995546#3995546
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995546
19 years, 7 months
[EJB 3.0] - java.lang.NoClassDefFoundError: org/jaxen/VariableContext
by frehan
When I upgraded from 4.0.4GA to 4.0.5GA I started to get problems with passivation, see below:
19:50:35,960 ERROR [SimpleStatefulCache] problem passivation thread
javax.ejb.EJBException: Could not passivate; failed to save state
at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersist
enceManager.java:363)
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:196)
at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:129)
Caused by: java.io.IOException ....
Caused by: java.lang.NoClassDefFoundError: org/jaxen/VariableContext
I do not have any clustering turned on and should not have any caching but I still get this problem. The class org/jaxen/VariableContext is in the jar jaxen.jar in jboss_home/server/default/lib so why can Jboss not find his class and why is it needed.
Any help is very much appreciated!
/Fredrik
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995539#3995539
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995539
19 years, 7 months