[JBoss AS 7 Development] - EAP jboss log.txt getting too large
by Ramanathan Lakshmanan
Ramanathan Lakshmanan [https://community.jboss.org/people/ars.ram] created the discussion
"EAP jboss log.txt getting too large"
To view the discussion, visit: https://community.jboss.org/message/786960#786960
--------------------------------------------------------------
I'm developing Struts 2 application and deploying that as war on EAP Jboss 6. At the beginning of development nothing gone wrong. But recently i realized that my disk space is grtting full because of log.txt file . When searching on web about this got lot of discussions but nothing helped me. From one post i tried to exclude log4j lib from the 'deployment-structure.xml' but nothing happened. Then i gone through standalone.xml file i found on subsystem tag which is *subsystem xmlns="urn:jboss:domain:logging:1.1".* i removed that completely and deleted log.txt from that location. Now file is not created. Then tried different things on that tag each time log.txt file was created and lo was getting populated. I tried log4j.properties in my project but file was created not populated.Now i could understand that the *subsystem xmlns="urn:jboss:domain:logging:1.1"* line calls the inbuilt jar file and a class from that jar creates the file. So please let me know where is that jar file actually located. I attached my log4j.properties with this query.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/786960#786960]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 3 months
[EJB3 Development] - Entity hashCode and equals overriding
by fabio valsecchi
fabio valsecchi [https://community.jboss.org/people/fabiovalse] created the discussion
"Entity hashCode and equals overriding"
To view the discussion, visit: https://community.jboss.org/message/786963#786963
--------------------------------------------------------------
Hi there,
I'm having some problems overring hashCode() and equals() methods of an entity Book. This is my code:
------------------------------------------------------------------------
@Override
public int hashCode() {
int hash = 1;
hash = hash * 31 + this.isbn.hashCode();
return hash;
}
@Override
public boolean equals(Object o) {
if (o==this)
return true;
if (o instanceof Book) {
return (this.isbn == ((Book) o).getIsbn());
}
return false;
}
------------------------------------------------------------------------
The problem is that when I try to add a book to a hashMap like here:
------------------------------------------------------------------------
@Override
public void addArticle(Book book, Integer quantity) {
Integer *currentQuantity* = cart.getArticles().get(book);
System.out.println(currentQuantity);
if (currentQuantity == null) {
currentQuantity = 0;
}
currentQuantity += quantity;
cart.getArticles().put(book, currentQuantity);
}
------------------------------------------------------------------------
The *currentQuantity* Integer is always null even if in the hashMap there's already the Book that i'm adding.
Maybe it's a problem of my hashCode and equals implementation but i've tried using a hashCode() that return always 1 and with an equals that return always true and *currentQuantity* is still null.
Can someone give me a hint?
Thank you in advance
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/786963#786963]
Start a new discussion in EJB3 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 3 months
[JBoss AS 7 Development] - JBoss AS 7 Support for XDoclet tag @jboss.method-attributes needed
by Ersin Canli
Ersin Canli [https://community.jboss.org/people/erscan] created the discussion
"JBoss AS 7 Support for XDoclet tag @jboss.method-attributes needed"
To view the discussion, visit: https://community.jboss.org/message/787667#787667
--------------------------------------------------------------
Hello,
we are migrating from JBoss AS 4.0.5 to JBoss AS 7.1.3.
We have a CMP Entity Bean (EJB 2.1) with a 1:n/n:1 relation (java.util.Set<ObjectXYZ>).
When we load the Entity outside of a transaction (for example by calling homeInterface.findByPrimaryKey(4711) and want to iterate over the relation "java.util.Set..." for example from a struts action we get the following Exception in JBoss AS 7.
"A CMR collection may only be used within the transaction in which it was created".
The Entity ist configured via XDoclet annotations/tags.
So we have the tag @jboss.method-attributes pattern = "get*" read-only = "true", which results to
<entity>
<ejb-name>....</ejb-name>
<configuration-name>CMP 2.x and Cache</configuration-name>
<method-attributes>
<method>
<method-name>get*</method-name>
<read-only>true</read-only>
</method>
</method-attributes>
</entity>
in jboss.xml.
In JBoss 7 AS the jboss.xml is not supported.
1. Question: How can I tell the getter-methods of my entity to be read-only in JBoss AS 7 ? Otherwise I will get the above Exception with the relation !
2. Querstion: How is it possible to deploy/configure/run a CMP Entity Bean (EJB 2.1) with a CMR without a transaction in JBoss AS 7.
Thanks.
Ersin.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/787667#787667]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 3 months
Re: [jboss-dev-forums] [JBoss AS 7 Development] - JBoss AS7 Securing Passwords
by Jason Greene
Jason Greene [https://community.jboss.org/people/jason.greene] commented on the document
"JBoss AS7 Securing Passwords"
To view all comments on this document, visit: https://community.jboss.org/docs/DOC-17248#comment-11342
--------------------------------------------------
> mentallurg wrote:
>
> The worst thing is that a Red Hat architect who designed and implemented it does not warn the users. Users have *false feeling of safety*. Wake up! You are in a big trouble if you use JBoss vault.
I agree a better warning is needed. Looks like you contributed most of that, thanks! However, as you yourself mention concealing and relocating passwords provides security value, it's just a very limited value, that only works in combination with other layers of security.
I don't think there was really any intention to mislead here. I myself took the "security through obscurity" quote was actually a reference to "security through obscurity is no security at all" :)
--------------------------------------------------
11 years, 3 months
Re: [jboss-dev-forums] [JBoss AS 7 Development] - JBoss AS7 Securing Passwords
by Jason Greene
Jason Greene [https://community.jboss.org/people/jason.greene] commented on the document
"JBoss AS7 Securing Passwords"
To view all comments on this document, visit: https://community.jboss.org/docs/DOC-17248#comment-11340
--------------------------------------------------
> Anil Saldhana wrote:
>
>
> Read, it says it uses "Password based Encryption" which is security by obscurity. It is not 100% security.
>
> To really get foolproof security of passwords, you either:
> a) use FIPS 140-2 certified keystore or
> b) use a 3rd party ISV implementation of the vault.
That's not fool proof. Hardware encryption will make it difficult to copy the store, but since you have to have the password in our config file, someone with access to the system can get those passwords the same way we can. User prompted password would be alot more secure, however, for reasons in mentallurg's article it's not very practical. Even with that though, it's not fool proof, if someone gains access to the system they dont even need to use the keystore. If they can get permissions to the running process (e.g. become the user running jboss), then they can take a memory dump of the JVM. Using the memory dump you can get the passwords out.
--------------------------------------------------
11 years, 3 months
[jBPM Development] - How to get content of task with Reserved and Completed state in JBPM5.4
by neeraj sharma
neeraj sharma [https://community.jboss.org/people/nsharm28] created the discussion
"How to get content of task with Reserved and Completed state in JBPM5.4"
To view the discussion, visit: https://community.jboss.org/message/787571#787571
--------------------------------------------------------------
Hi,
Currently I am reteriving the task content using following methods
-Following method reterives content of task which are in 'Completed' status
public Object getContent(long taskId)
{
Task task = taskService.getTask(taskId);
TaskData taskData = task.getTaskData();
Content content =taskService.getContent(taskData.getDocumentContentId());
ByteArrayInputStream bais = new ByteArrayInputStream(content.getContent());
ObjectInputStream ois;
Object taskinfo = null;
try {
ois = new ObjectInputStream(bais);
taskinfo = ois.readObject();
} catch (Exception e) {
e.printStackTrace();
}
return taskinfo;
}
-Following method reterives content of task which are in 'Reserved' status
public Object getContentNew(long taskId) {
Task task= taskService.getTask(taskId);
Object input=null;
long contentId = task.getTaskData().getDocumentContentId();
if (contentId != -1) {
Content content = taskService.getContent(contentId);
input = ContentMarshallerHelper.unmarshall(content.getContent(), null);
}
System.out.println(input);
return input;
}
Is there any single method or way to reterive the content of task for both Completed and Reserved status??
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/787571#787571]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 3 months