[Security & JAAS/JBoss] - Re: Getting Exception while trying to access a Stateless EJB
by dvuday
"jaikiran" wrote : anonymous wrote : Properties props = new Properties();
| |
| | props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
| | props.put(Context.PROVIDER_URL,"jnp://localhost:8080");
| | Context ctx = new InitialContext(props);
|
| This should be:
|
| Properties props = new Properties();
| |
| | props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
| | props.put(Context.PROVIDER_URL,"jnp://localhost:1099");
| | Context ctx = new InitialContext(props);
Thank you very much for quick response jaikiran. I tried to execute the client program by the changes you mentioned above. But still getting Exception. I have included the log4j.jar from <JBOSS_HOME>\client\ both in the build path of the project and in the jboss configuration.(Jboss is configured in eclipse).
Can you please help me to come out of this exception...
--------------------------------------------------------------------------------------------------------------------
The ejb-jar.xml file is
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xs1="http://www.w3.org/2001/XMLSchema-instance" xs1:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">
<enterprise-beans>
<ejb-name>HelloHome</ejb-name>
examples.ejb21.HelloHome
examples.ejb21.Hello
<local-home>examples.ejb21.HelloLocalHome</local-home>
examples.ejb21.HelloLocal
<ejb-class>examples.ejb21.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</enterprise-beans>
</ejb-jar>
--------------------------------------------------------------------------------------------------------------------
Exception is
log4j:WARN No appenders could be found for logger (org.jnp.interfaces.NamingContext).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1399)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(Unknown Source)
at client.HelloClient.main(HelloClient.java:37)
Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
... 4 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
... 5 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
... 5 more
Thanks in advance
Uday
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993122#3993122
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993122
19 years, 4 months
[JBoss Seam] - Re: Problem with selectItems taglib
by dave.rogers
Here's my very crude solution:
In BasicEntityConvertor, comment out the entity check in the findIdMethod method
protected Method findIdMethod(Class clazz) {
| // Check that the class passed is an entity
| //if (!(clazz.isAnnotationPresent(Entity.class))) {
| // throw new ConverterException(getMessage(NOT_AN_ENTITY + " " + clazz.getName()));
| //}
and the same in the findIdField
protected Field findIdField(Class clazz) {
| // Check that the class passed is an entity
| //if (!(clazz.isAnnotationPresent(Entity.class))) {
| // throw new ConverterException(getMessage(NOT_AN_ENTITY + " " + clazz.getName()));
| //}
Now I don't know what the implications of this are; probably poor error output if the class really isn't an entity. Otherwise it works. Thanks for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993118#3993118
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993118
19 years, 4 months
[Clustering/JBoss] - Re: Clustering NOT working on physical separate boxes.
by rajeshchande
Hello JBoss team,
Thanks for the links, that did help me perform the necessary steps. Finally I was able to get each of the nodes identify each other.
#####m/c1#########
| 15:59:33,679 INFO [Server] JBoss (MX MicroKernel) [4.0.3SP1 (build: CVSTag=JBos
| s_4_0_3_SP1 date=200510231054)] Started in 41s:253ms
| 16:02:20,112 INFO [devl-partition-01] New cluster view for partition devl-partition-01 (id: 1, delta: 1) : [3.187.196.86:53043, 3.187.200.23:53043]
| 16:02:20,116 INFO [devl-partition-01] Merging partitions...
| 16:02:20,116 INFO [devl-partition-01] Dead members: 0
| 16:02:20,117 INFO [devl-partition-01] Originating groups: [[server-1
| -bak:49934 (additional data: 18 bytes)|0] [server-1-bak:49934 (additional data: 18 bytes)], [172.17.132.140:59013 (additional data: 18 bytes)|0] [172.17.132.140:59013 (additional data: 18 bytes)]]
| #####m/c1#########
#####m/c-2#########
| 15:55:59,974 INFO [Server] JBoss (MX MicroKernel) [4.0.3SP1 (build: CVSTag=JBos
| s_4_0_3_SP1 date=200510231054)] Started in 1m:8s:90ms
| 16:02:20,110 INFO [devl-partition-01] New cluster view for partition devl-partition-01: 1 ([3.187.196.86:53043, 3.187.200.23:53043] delta: 1)
| 16:02:20,111 INFO [devl-partition-01] Merging partitions...
| 16:02:20,112 INFO [devl-partition-01] Dead members: 0
| 16:02:20,113 INFO [devl-partition-01] Originating groups: [[172.17.132
| .70:49934 (additional data: 18 bytes)|0] [172.17.132.70:49934 (additional data:18 bytes)], [server2_b:59013 (additional data: 18 bytes)|0] [server2_b:590
| 13 (additional data: 18 bytes)]]
| #####m/c-2#########
I did the following changes:
1) In the "run.sh" specified -Djboss.partition.name=devl-partition-01 -Djboss.partition.udpGroup=228.1.2.4
2) UDP parameters deploy/cluster-service.xml look like as shown below:
############
| <UDP bind_addr="172.17.132.70" mcast_addr="228.8.8.8" mcast_port="45566"
| ip_ttl="32" ip_mcast="true"
| mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
| ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
| loopback="true" max_bundle_size="60000" max_bundle_timeout="30"
| use_incoming_packet_handler="false" use_outgoing_packet_handler="false"
| enable_bundling="false" />
| ############
So they see each other now.
But, When i deploy a war file in the "farm" folder of server-1 on first m/c, local deployment on the server-1 happens successfully, but the node on the second m/c does not seem to pull the newly deployed WAR file and vice versa. So the FARM Deployment is failing.
Any idea, why this is failing? Do I need to change anything in deploy/tc5-cluster-service.xml to make "farm" deployment workable?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993116#3993116
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993116
19 years, 4 months
[Persistence, JBoss/CMP, Hibernate, Database] - Sybase database pool not claiming used connections
by viniciuscarvalho
** Also post this under JCA Forum, sorry for the dual post, hoping get some help ASAP **
Hello there! We have a JBoss 4.0.1sp1 + Sybase 12 + JConnect 5.5 with a 50 connections pool. We use a monitor (currentAvailableConnections from web-console) to check the number of available connections, what can be seen is that the pool is "shrinking", the graph looks like a stair, it starts with 45-50 available connections, then after a time (15min or so) it reduces to 40-45... and goes on. Even during lunch time where the application is almost not accessed the pool does not seem to claim its used connections back.
What we are doing is forcing a flush on the MBean in order to free the resources. We also use a mysql and that database pool does return to original state after not being used.
Also, checking the sybase it shows that it has 50 connections and 90% of them are on WAITING_COMMAND state.
I wonder what might be the problem. any idea?
Could be the idle_timeout for the pool? The driver?
Best regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993114#3993114
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993114
19 years, 4 months
[JCA/JBoss] - Sybase database pool not claiming used connections
by viniciuscarvalho
Hello there! We have a JBoss 4.0.1sp1 + Sybase 12 + JConnect 5.5 with a 50 connections pool. We use a monitor (currentAvailableConnections from web-console) to check the number of available connections, what can be seen is that the pool is "shrinking", the graph looks like a stair, it starts with 45-50 available connections, then after a time (15min or so) it reduces to 40-45... and goes on. Even during lunch time where the application is almost not accessed the pool does not seem to claim its used connections back.
What we are doing is forcing a flush on the MBean in order to free the resources. We also use a mysql and that database pool does return to original state after not being used.
Also, checking the sybase it shows that it has 50 connections and 90% of them are on WAITING_COMMAND state.
I wonder what might be the problem. any idea?
Could be the idle_timeout for the pool? The driver?
Best regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993113#3993113
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993113
19 years, 4 months