[Beginners Corner] - Re: hostname
by mithilwane
JBoss version is 4.2.2 and jdk is 1.5.0_14
my hosts file has two entries
127.0.0.1 localhost
192.168.0.230 linuxserver myserver.server.com
jndi props looks like this
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=jnp://myserver.server.com:1099
i get this exception in my client
Running default port
D:\WorkCVS\EMS
Exception:javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: myserver.server.com; nested exception is:
java.net.UnknownHostException: myserver.server.com]
javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: myserver.server.com; nested exception is:
java.net.UnknownHostException: myserver.server.com]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:780)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.alphion.fm.client.FaultManageClient.init(FaultManageClient.java:48)
at com.lopsys.nms.client.fault.FaultManagerGUIClient.init(FaultManagerGUIClient.java:54)
at com.alphion.main.MainFrame.(MainFrame.java:111)
at com.alphion.main.MainFrame.main(MainFrame.java:571)
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 com.alphion.main.EMSSplash.main(EMSSplash.java:57)
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 com.alphion.main.WelcomeFrame.main(WelcomeFrame.java:167)
Caused by: java.rmi.UnknownHostException: Unknown host: myserver.server.com; nested exception is:
java.net.UnknownHostException: myserver.server.com
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:572)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
... 16 more
Caused by: java.net.UnknownHostException: myserver.server.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:520)
at java.net.Socket.connect(Socket.java:470)
at java.net.Socket.(Socket.java:367)
at java.net.Socket.(Socket.java:180)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
... 21 more
java.lang.reflect.InvocationTargetException
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 com.alphion.main.EMSSplash.main(EMSSplash.java:57)
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 com.alphion.main.WelcomeFrame.main(WelcomeFrame.java:167)
Caused by: java.lang.NullPointerException
at com.alphion.fm.client.FaultManageClient.addAlpClientEventListener(FaultManageClient.java:75)
at com.lopsys.nms.client.fault.FaultManagerGUIClient.init(FaultManagerGUIClient.java:55)
at com.alphion.main.MainFrame.(MainFrame.java:111)
at com.alphion.main.MainFrame.main(MainFrame.java:571)
... 10 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115437#4115437
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115437
18 years, 3 months
[Tomcat, HTTPD, Servlets & JSP] - consumes much memory when number of servlets grows
by unnis
I have one ear with size 140MB and has been deployed in jboss 3.2.5.and
runs smothly.
This ear contains files from 20 different modules. So i planned to split ear in to multiple war file in the following manner.
one main.ear contains main.jar and main.war.
Jar contains my EJB classes ( Number of EJB classes are very less in my application ). war file contains other common files and common jsp files.
seperate module jar files with following .
java classes of the particular module
pre-compiled Jsp files of the module jsp.( Since jsp's are pre compiled these entries will go to web.xml)
main.war will be having servlets entries of all the pre-compiled jsp's. The count comes around 6000. All these module jar files and ear is put in to deploy folder.But when I deploy it , it is found that jboss is taking 200MB more memory than the previous one.But still i am having 350 MB free memory in the system. And When I take the applet in jboss web-console memory usage increases gradually and finally throws outofmemeory error. But in the case of single ear this applet works well.
Any help is appreciated.
thanks & regards
unnis
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115435#4115435
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115435
18 years, 3 months
[JBoss Seam] - Memory leak in SFSB in session scope in Seam 2.0.0 on JBoss
by susnet
Hi!
I upgraded to Seam 2.0.0.GA and it is running on JBoss 4.2.2.
I have a SFSB in Session scope. The SFSB has an ObjectPool, which is really just a Collection of Entities. The entities in the collection are of type TeaserRecipe which just maps to a table in my database.
For each httpRequest for certain pages the method getNextTeaserRecipes() are called. This is configured in pages.xml.
Now to the strange behaviour. If I just use the default settings for conversation timeout and session timeout OR if i set it to for example:
conversation timeout = 600000 ( = 10 minutes)
session timeout = 10
Then the number of instances of TeaserRecipe just grows and gradually leads to OutOfMemoryException. I have also tested a lot of other configurations where session timeout is much longer than conversation timeout and vice versa, all with the same result -> Growing number or instances and OutOfMemoryException if I just wait long enough before restarting JBoss.
But if don't set any conversation timeout at all AND set session timeout to 2 minutes it works fine and the instances don't grow and gets garbage collected as they should.
Any Ideas????
My SFSB. It has 4 objectPools in reality, but i stripped it to one to save some space and making it easier to read.
| import java.util.*;
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.ejb.Stateless;
| import javax.persistence.*;
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.*;
| import org.jboss.seam.log.Log;
| import recepten.common.ObjectPool;
| import recepten.entities.db.TeaserRecipe;
|
| @Stateful
| @Name("recipeTeaserService")
| @Scope(ScopeType.SESSION)
| public class RecipeTeaserServiceBean implements
| recepten.actions.RecipeTeaserServiceLocal {
|
| @Logger Log log;
|
| @PersistenceContext(type = PersistenceContextType.EXTENDED)
| private EntityManager em;
|
| ObjectPool<TeaserRecipe> recipePoolSidebarLeft1;
|
| private TeaserRecipe recipeSidebarLeft1;
|
| public RecipeTeaserServiceBean() {
| }
|
| @Create
| public void initPools() {
| // Create new objectPools
| recipePoolSidebarLeft1 = new ObjectPool<TeaserRecipe>();
|
| // Create a pool of the pools
| ArrayList<ObjectPool<TeaserRecipe>> poolList = new ArrayList<ObjectPool<TeaserRecipe>>();
| poolList.add(recipePoolSidebarLeft1);
|
| // Get recipes from database
| List<TeaserRecipe> teaserRecipeList = em
| .createQuery(
| "SELECT t FROM TeaserRecipe t WHERE t.show = true ORDER BY seq")
| .getResultList();
|
| int poolListIndex = 0;
| for (TeaserRecipe teaserRecipe : teaserRecipeList) {
| poolList.get(poolListIndex).add(teaserRecipe);
| if (++poolListIndex == poolList.size()) {
| poolListIndex = 0;
| }
| }
| }
|
| public TeaserRecipe getRecipeSidebarLeft1() {
| return recipeSidebarLeft1;
| }
|
|
| public void getNextTeaserRecipes() {
| // Get next recipe from pool
| recipeSidebarLeft1 = recipePoolSidebarLeft1.next();
| }
|
| @Destroy
| @Remove
| public void destroy() {
| }
|
ObjectPool:
| package recepten.common;
|
| import java.util.ArrayList;
| import java.util.Collections;
|
| public class ObjectPool<T> {
|
| ArrayList<T> list = new ArrayList<T>();
| int pointer;
|
| public ObjectPool() {}
|
| public void add(T instance) {
| list.add (instance);
| }
|
| public T next(){
| if (++pointer == list.size()) {
| pointer = 0;
| }
| if (list.size () == 0) {
| return null;
| }
| return list.get(pointer);
| }
|
| public void shuffle() {
| Collections.shuffle (list);
| }
| }
|
TeaserRecipe:
| @Entity
| @Table(name = "teaserrecipe")
| public class TeaserRecipe implements Serializable {
|
| @Id
| @Column(name = "recipeid", nullable = false)
| private Integer recipeid;
|
| @Column(name = "headline")
| private String headline;
|
| @Column(name = "teasertext")
| private String teasertext;
|
| @Column(name = "seq", nullable = false)
| private int seq;
|
| @Column(name = "show", nullable = false)
| private boolean show;
|
| @JoinColumn(name = "recipeid", referencedColumnName = "recipeid", insertable = false, updatable = false)
| @OneToOne
| private Recipe recipe;
|
| /** Creates a new instance of TeaserRecipe */
| public TeaserRecipe () {
| }
|
| // Getters and setters and overridden equals, toString and hashcode methods.
| }
|
pages.xml (only the interesting part)
| <page view-id="/pages/*">
| <action execute="#{recipeTeaserService.getNextTeaserRecipes}"/>
| </page>
|
The same code worked fine in Seam 1.2.1. and JBoss 4.0.5.
Please tell me if there are some more code you would like to see.
Any help is appreciated since now I'm forced to have a session timeout set to 2 minutes which leads to many View experiation exceptions since the timeout is too short.
Thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115434#4115434
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115434
18 years, 3 months
[Beginners Corner] - the right choice ?
by nitm
hi,
this is a very general question, regarding a lot of JBoss products.
we want to set up a server for development purposes, we are very new to this whole server business.
this so called "server" is a regular pc running a windows xp os, connected to a 5MB adsl connection with a fixed ip address.
after a lot of searching and reading we found that the JBoss products are right for us since we want the server to run mainly on java.
we installed the JBoss AS 4.2.2 and we're having a lot of hard time configuring it to work the way we want (you can search for my username and see a lot of posts all over the jboss forums).
since we probably made a lot of false configuring we think that it might be smart to start over now that we know a bit more (though not enough).
the problem is that there's a new jboss AS now and so our question is this:
should we go with the JBoss AS 5 or the 4.2.x ?
the 4.2.x have more documentation and more examples so it will probably be easier to configure BUT we saw that the 5.x has major differences and so it might be foolish to start with something that will be deprecated soon.
our goal is a server that will have the following features:
- J2EE support (including EJBs)
- MySql database as the jboss datasource
- hibernate
- php for the "view" part of our application
- a version control software (like subversion)
- ftp access (does this have anything to do with the jboss at all?)
in addition we might want to use JBoss Cache, Mobicents and probably a few more JBoss products (including the JBoss Tools).
how should we go about this?
thanks, nitzan.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115426#4115426
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115426
18 years, 3 months