[Security & JAAS/JBoss] - AccessControlException when looking up TopicConnectionFactor
by ossah
Jboss-4.0.5.GA
Hi there,
I'm trying to subscribe to to a topic with a client (not running in jboss). However, a lookup results in a:
AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
I can lookup the remote interfaces, so I suspect that this is somehow related to the security settings of TopicConnectionFactory.
Any ideas?
Your help is appreciated!
I set System.setSecurityManager(new RMISecurityManager());
topicConnectionFactory = (TopicConnectionFactory)
| jndiContext.lookup("TopicConnectionFactory");
javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: java.security.AccessControlException: access denied (java.net.SocketPermission 230.0.0.4 connect,accept,resolve) [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at de.fumbs.test.MessageListenerTest.(MessageListenerTest.java:68)
at de.fumbs.test.MessageListenerTest.main(MessageListenerTest.java:175)
Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
... 5 more
Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
at java.net.Socket.connect(Socket.java:513)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.(Socket.java:366)
at java.net.Socket.(Socket.java:266)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)
... 6 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037382#4037382
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037382
19 years
[JBossWS] - Soap with attachments
by ltenmatay
Would like to know how to support soap message with attachments in jbossws 1.2.0 SP1. Do I need to define multipart section in my wsdl? The wsdl i got didn't specify any mime sections. I created my own provider. Whenever I send a soap with attachment, the jboss will throw a timeout error and it does not reach the provider.
I am using saaj and the message is something like this
------=_Part_0_22691179.1176653070718
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-Id: <DBE397F2170DBC1661EAE25D43A5648C>
soap xml
------=_Part_0_22691179.1176653070718
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Id: <BAA0447E233B834E9A84A6829880E34D>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037378#4037378
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037378
19 years
[EJB 3.0] - Many-to-Many and cascade pronlem ?
by ericmacau
Hello,
In the following code, User and Role. When I tried to remove User, it will remove all the roles in the ROLE that the user has and also all the related records in the USER_ROLE_LINK.
For example,
User u = new User();
Role a = new Role("A");
Role b = new Role("B");
// persist a and b
ArrayList roles = new ArrayList();
roles.add(a);
roles.add(b);
u.setRoles(roles);
//persist u
.....
em.remove(u);
For the above codes, it wiil cause the problem that I described above.
How can I only remove the User and the related records in the USER_ROLE_LINK when tried to remove a single user?
And how can I remove all the users that a role have when remove a ROLE ?
| public class User {
|
| ...
| @ManyToMany (cascade=CascadeType.ALL,
| mappedBy = "users", targetEntity = Role.class)
| public Collection<Role> getRoles() {
| return roles;
| }
|
| ...
|
| }
|
|
| public class Role {
| ...
| @ManyToMany (fetch = FetchType.EAGER, targetEntity = User.class, cascade=CascadeType.REMOVE)
| @JoinTable (name = "USER_ROLE_LINK", joinColumns = {
| @JoinColumn (name = "ROLENAME")
| }, inverseJoinColumns = {@JoinColumn (name = "USERNAME")
| })
| public Collection<User> getUsers() {
| return users;
| }
|
| ...
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037370#4037370
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037370
19 years
[JBoss jBPM] - Re: How to run a timer
by s_aliakbary
Hi again
According to some posts on this forum, I added these lines to my web.xml :
| <servlet>
| <servlet-name>JbpmThreadsServlet</servlet-name>
| <servlet-class>org.jbpm.web.JbpmThreadsServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
| <servlet-mapping>
| <servlet-name>JbpmThreadsServlet</servlet-name>
| <url-pattern>/threads</url-pattern>
| </servlet-mapping>
|
But now every 5 seconds I see an exception :
anonymous wrote :
| org.hibernate.HibernateException: /hibernate.cfg.xml not found
| at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
| at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1287)
| at org.hibernate.cfg.Configuration.configure(Configuration.java:1309)
| at org.hibernate.cfg.Configuration.configure(Configuration.java:1296)
| at org.jbpm.db.hibernate.HibernateHelper.createConfiguration(HibernateHelper.java:93)
| at org.jbpm.persistence.db.DbPersistenceServiceFactory.getConfiguration(DbPersistenceServiceFactory.java:68)
| at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)
| at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:74)
| at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:78)
| at org.jbpm.persistence.db.DbPersistenceService.getMessagingSession(DbPersistenceService.java:234)
| at org.jbpm.JbpmContext.getMessagingSession(JbpmContext.java:411)
| at org.jbpm.msg.db.DbMessageService.(DbMessageService.java:49)
| at org.jbpm.msg.db.DbMessageServiceFactory.openService(DbMessageServiceFactory.java:32)
| at org.jbpm.svc.Services.getService(Services.java:136)
| at org.jbpm.svc.Services.getMessageService(Services.java:172)
| at org.jbpm.msg.command.CommandExecutorThread.executeCommand(CommandExecutorThread.java:111)
| at org.jbpm.msg.command.CommandExecutorThread.run(CommandExecutorThread.java:79)
|
(I'm using springmodules to integrate jbpm to my project, so I have not any hibernate.cfg.xml file)
Any idea?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037369#4037369
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037369
19 years