[JBoss Tools] New message: "Re: Switching seam debug mode"
by Piotr Sobczyk
User development,
A new message was posted in the thread "Switching seam debug mode":
http://community.jboss.org/message/523075#523075
Author : Piotr Sobczyk
Profile : http://community.jboss.org/people/piotr.sobczyk
Message:
--------------------------------------------------------------
Allright in order to turn off debug mode in JBoss Tools project you have to:
1. set debug="false" in components.xml
2. go to build path settings from project and change output folder for /src/hot to {project.name}/build/classes
In effect in WEB-INF there will be both dev directory with hot classes but this directory will be out of classpath (not visible for Seam).
I tried to do what Max suggested: I removed the /src/hot -> /WEB-INF/dev mapping from Module Assembly but it didn't change anything.
In order to turn it on you have to do the opposite (debug="true",set /src/hot output folder {project.name}/WebContents/WEB-INF/dev).
I've lost a lot of time experimenting because I was confused by different treating of main and hot source directories - main is build to build directory and then moved to WEB-INF/main while hot is build right to WEB-INF/dev inside project and moved with whole WEB-INF to WEB-INF on server. Is that different treating of src/hot requirement of hot deployment?
Would it have sense to add some high level functionality to JBoss Tools that switches between debug modes (eg. radio button: debug/production). I guess I'm not only man who deploys Seam applications through JBoss Tools not by home made Ant script imitating Seam-gen's one. I wouldn't suspect that deploing to production would be such problem.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/523075#523075
15 years
[JBoss Tools] New message: "Newbie - Problem Generating Entities from Existing Empty DB."
by Ran Bittmann
User development,
A new message was posted in the thread "Newbie - Problem Generating Entities from Existing Empty DB.":
http://community.jboss.org/message/523074#523074
Author : Ran Bittmann
Profile : http://community.jboss.org/people/rmbittmann
Message:
--------------------------------------------------------------
Hi Again,
I am using: Eclipse 3.5.1, JBoss Tools 3.1.0.CR1, TestNG 5.11.0.28, jdk1.6.0_17, JBoss AS 5.1.0GA-jdk6, Seam 2.2.0.GA, JBoss 4.2.2GA & MySQL 5.1.37.
I added a schema to my MySQL DB with some tables. There are no values in the tables.
I created a Seam Web Project, with a with a Database connection to the schema, tested it and the connection works fine.
I tested the project with the home page and again everything is fine.
Going to the Database perspective I can browse the schema and its tables and fields, so far so good.
Now I am trying to generate an entity:
I right click on the project name -> New -> Generates Seam Entities with the default Seam Project and Hibernate Console Configuration and the Reverse engineer from database checked.
Click Next to the select table page. Press the Refresh button and get the configured Schema from above with a + on the left indicating it can be expanded so I can select the table I choose for entity generation.
Trying to expand it (clicking on the small + on the left) *nothing happens!* There are no tables available in the Schema.
I will appreciate your help in telling me what I am doing wrong or where to look for a solution.
Thanks,
Rani.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/523074#523074
15 years
[JBoss Cache] New message: "Jboss cache TransactionCompletedEvent in Jboss AS 5.1"
by Frank Cheng
User development,
A new message was posted in the thread "Jboss cache TransactionCompletedEvent in Jboss AS 5.1":
http://community.jboss.org/message/523069#523069
Author : Frank Cheng
Profile : http://community.jboss.org/people/chengsuntx
Message:
--------------------------------------------------------------
I am trying to add transaction support to Jboss Cache. The TransactionComplted listener got hit when the transaction was commited or whenever a read happened to the cache. The cache root in TransactionCompletedEvent is always null.
Here is the code I am using:
@CacheListener
public class JbossCacheListener {
private static Log logger = LogFactory.getLog(JbossCacheListener.class);
public static String DEFAULT_CONFIC_CACHE_NAME = "config-default-name";
private InitialContext context;
private Cache cache;
private TransactionManager transMgr;
public boolean init(){
try {
this.context = new InitialContext();
CacheManager cacheManager = (CacheManager)context.lookup("java:CacheManager");
cache = cacheManager.getCache(DEFAULT_CONFIC_CACHE_NAME, true);
if (cache == null) {
logger.error("Unable to find cache " + DEFAULT_CONFIC_CACHE_NAME + ", jboss cache isn't configured properly.");
return false;
}
cache.start();
cache.addCacheListener(this);
GenericTransactionManagerLookup tranLookup = new GenericTransactionManagerLookup();
transMgr = tranLookup.getTransactionManager();
} catch (NamingException e1) {
logger.error("unable to find initial context by naming service; " + e1);
return false;
} catch (Exception e) {
logger.error("unable to find initial context by naming service; " + e);
return false;
}
try {
transMgr.begin();
loadConfig(); // load data to the cache through bunch of puts
transMgr.commit();
} catch (Exception e) {
try { transMgr.rollback(); } catch(Throwable t) {}
logger.error("Unable to load cluster configuration; " + e);
return false;
}
return true;
}
@TransactionCompleted
public void perform(TransactionCompletedEvent te)
{
logger.info("An trans complete event " + te.getType() + " isOriginLocal " + te.isOriginLocal() + " isSuccessful " + te.isSuccessful() + " has occured");
if (te.getCache().getRoot() == null) {
logger.info("cache root is null from TransactionCompletedEvent after complete.");
return;
}
logger.info("transEvent: " + te.getTransaction().toString());
}
private void loadConfig() {
Node rootNode = cache.getRoot();
Node personRecordsNode = rootNode.addChild(Fqn.fromString("/org/mycompany/personRecords"));
personRecordsNode.put("name", "Peter");
personRecordsNode.put("address", "1 main st");
}}
And here is some of the configuration properties.
<property name="transactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup</property>
<property name="nodeLockingScheme">OPTIMISTIC</property>
<property name="useLockStriping">false</property>
<property name="cacheMode">REPL_ASYNC</property>
Perform function gots called and te.getCache().getRoot() is null. And also, perform gots call whenerver a read happened on any of the nodes in the cache and te.getCache().getRoot() is null.
Any idea on this? Thanks in advance.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/523069#523069
15 years
[JBoss Microcontainer] New message: "Re: Lookup up a POJO service without injecting it inside -beans.xml?"
by Martin N
User development,
A new message was posted in the thread "Lookup up a POJO service without injecting it inside -beans.xml?":
http://community.jboss.org/message/523066#523066
Author : Martin N
Profile : http://community.jboss.org/people/MartinN
Message:
--------------------------------------------------------------
That's what I did eventually. I had a misunderstanding with the software architect - I understood him that I wasn't supposed to modify his interface, which I thought meant, no adding of injection setters/getters on the implementation classes - thus I asked you how to get at the kernelcontrollercontext via the locator pattern... Turns out, after talking to him, he only meant not modifying the _actual_ interface (public interface xxx...) and he was fine with me adding injectors (setters) on the impl....
He was trying to develop some sort of a 'generic' interface for some of our products that he didn't want bound to anything jboss-y, that we could reuse anywhere, outside jboss or any other container.... long story that I can't quite fill you in on unless you come work for us .
Hvala.
Martin
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/523066#523066
15 years
[jBPM] New message: "Re: How to get sub process instance id"
by Santanu Saraswati
User development,
A new message was posted in the thread "How to get sub process instance id":
http://community.jboss.org/message/523064#523064
Author : Santanu Saraswati
Profile : http://community.jboss.org/people/saraswati.santanu
Message:
--------------------------------------------------------------
Giuseppe,
I am really surprised. I tried in multiple ways, but I always get correct values in "executions" collection. I have gone thourgh the queries fired and the hibernate mapping of ExecutionImpl and everything justifies that.
When you call this:
ProcessInstance mainProcessInstance = (ProcessInstance)executionService.findProcessInstanceById(mainProcessInstanceId);
These are the queries which gets fired:
select * from ( select executioni0_.DBID_ as DBID1_0_, executioni0_.DBVERSION_ as DBVERSION3_0_, executioni0_.ACTIVITYNAME_ as ACTIVITY4_0_, executioni0_.PROCDEFID_ as PROCDEFID5_0_, executioni0_.HASVARS_ as HASVARS6_0_, executioni0_.NAME_ as NAME7_0_, executioni0_.KEY_ as KEY8_0_, executioni0_.ID_ as ID9_0_, executioni0_.STATE_ as STATE10_0_, executioni0_.SUSPHISTSTATE_ as SUSPHIS11_0_, executioni0_.PRIORITY_ as PRIORITY12_0_, executioni0_.HISACTINST_ as HISACTINST13_0_, executioni0_.PARENT_ as PARENT14_0_, executioni0_.INSTANCE_ as INSTANCE15_0_, executioni0_.SUPEREXEC_ as SUPEREXEC16_0_, executioni0_.SUBPROCINST_ as SUBPROC17_0_ from JBPM4_EXECUTION executioni0_ where executioni0_.ID_=? ) where rownum <= ?
and a number of
select executions0_.PARENT_ as PARENT14_1_, executions0_.DBID_ as DBID1_1_, executions0_.PARENT_IDX_ as PARENT18_1_, executions0_.DBID_ as DBID1_0_0_, executions0_.DBVERSION_ as DBVERSION3_0_0_, executions0_.ACTIVITYNAME_ as ACTIVITY4_0_0_, executions0_.PROCDEFID_ as PROCDEFID5_0_0_, executions0_.HASVARS_ as HASVARS6_0_0_, executions0_.NAME_ as NAME7_0_0_, executions0_.KEY_ as KEY8_0_0_, executions0_.ID_ as ID9_0_0_, executions0_.STATE_ as STATE10_0_0_, executions0_.SUSPHISTSTATE_ as SUSPHIS11_0_0_, executions0_.PRIORITY_ as PRIORITY12_0_0_, executions0_.HISACTINST_ as HISACTINST13_0_0_, executions0_.PARENT_ as PARENT14_0_0_, executions0_.INSTANCE_ as INSTANCE15_0_0_, executions0_.SUPEREXEC_ as SUPEREXEC16_0_0_, executions0_.SUBPROCINST_ as SUBPROC17_0_0_ from JBPM4_EXECUTION executions0_ where executions0_.PARENT_=?
The first one is to load the process inastance whose id you passed and the other ones are for the child execution(s) of that (please note the where clause of the second query). And if your sub process instance exists then one of the executions will have the name as that of the transition you made to reach the sub process. In the sub process execution object you will find the execution for your wait state.
The queries to load childen execution instance are made because in hibernate mapping they are non lazy. Here is the snippet of the hibernate mapping (note lazy=false here):
<list name="executions"
cascade="all-delete-orphan"
inverse="false"
lazy="false">
<key column="PARENT_" foreign-key="FK_EXEC_PARENT" />
<list-index column="PARENT_IDX_" />
<one-to-many class="ExecutionImpl" />
</list>
I am sure that it gives the correct list. I tried with Oracle and PostgreSQL (though does not make sense, but still to check if there is any db dependency), but for both I got the same behaviour.
About LazyInitializationException - if you are conversant with hibernate, then you already know that hibernate proxy objects are bound to a session. Once the session is closed they become orphan and become useless. So the probable reason for getting the exception is if you get the main object (here the mainProcessINstance object) in one session and try to get the proxy in another session (or out of the session). You may need to look at the transaction boundaries. Wrong transaction boundary will close the session at a wrong place.
If you can give some more detail of your implementation then I can try. I am pretty sure it works.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/523064#523064
15 years
[JBoss Tools] New message: "Re: Adding JBoss AS source to a project"
by Denis Golovin
User development,
A new message was posted in the thread "Adding JBoss AS source to a project":
http://community.jboss.org/message/523063#523063
Author : Denis Golovin
Profile : http://community.jboss.org/people/dgolovin
Message:
--------------------------------------------------------------
It works only for Debug view, because sources to lookup attached to particular process.
But you're right that there are several places where you can access sources in eclipse:
1. Classpath jar browsing
2. Ctrl+Click navigation in source
3. Debug View Stacktrace browsing
1 and 2 are based on sources attached to jar files in project Classpath
3 is actually using "chain of responsibility", it tries to get sources attached to jars and then source lookup (need to check if that right suggestion )
So solution here would be to have field or complex widget (like Source Lookup) in new server runtime wizard and server runtime editor to configure server sources location(s)/lookup. As soon as we have that 1,2 and 3 can be configured automatically for project and server launcher.
For instance, you created JBoss AS 4.2.2 runtime and provided an archive with sources. This archive can be used to initialize Java Source Attachment preferences for every jar in server classpath container and that means points 1,2 should work. Source Lookup also can be configured using provided archive and that makes point 3 working as well.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/523063#523063
15 years
[JBoss Tools] New message: "Re: Adding JBoss AS source to a project"
by Denis Golovin
User development,
A new message was posted in the thread "Adding JBoss AS source to a project":
http://community.jboss.org/message/523062#523062
Author : Denis Golovin
Profile : http://community.jboss.org/people/dgolovin
Message:
--------------------------------------------------------------
> atijms wrote:
>
> I tried exactly what you said, but it doesn't seem to work. It seems like this only works for directories containing .java files, not for directories containing .jar files.
>
> When I click on "Edit Source Lookup..." again, then my source directory "jboss-5.1.0.GA-src" has indeed been added, and when I unfold it I can see all directories of the source archive, but unlike the "Default" source lookup path, not a single jar file is listed.
Right, it is solution for JBoss AS only, because they have source distribution archive which contains only *.java files inside. Eclipse has no source lookup type, that visiting jar files. But you can use Archive or External Archive type to configure them. It supports multi selection so it should be easier than configuring them one by one
BTW this External Archive type can be used to configure JBoss AS sources without unpacking sources archive.
> atijms wrote:
>
> I think a big problem regarding JBoss AS sources is that the structure of the source archive is *completely* different from that of the compiled product. For instance, suppose you were looking for the sources of jboss-web-service.jar. This file is located in the binary distribution at /server/default/deploy/jbossweb.sar/jboss-web-service.jar. There is *no* way the source code location even remotely resembles this. Even if the path would not exactly match (since it's actually /server/*/deploy/jbossweb.sar/jboss-web-service.jar), then still one would expect some file called jboss-web-service-src.jar.
>
> Again, this is not how the source is organized. Maybe the source of jboss-web-service-src.jar is within an archive located in thirdpary/jboss/foo/bar/kaz-all.jar. You just don't know... and -that- is the problem.
The problem is that JBoss AS sources doesn't include 3rd party sources, I guess. It includes only sources that are really compiled during build. If something was bundled in as binary dependency, it has no sources inside JBoss AS source distribution. To configure source look up for 3rd party jars you need to process one jar at time and that can be done when required by using "Attach Source..." button.
We have source browser implementation that understands *src.zip archives, but that in lab component and it is not included in build.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/523062#523062
15 years
[JBoss Tools] New message: "Re: Switching seam debug mode"
by Piotr Sobczyk
User development,
A new message was posted in the thread "Switching seam debug mode":
http://community.jboss.org/message/523057#523057
Author : Piotr Sobczyk
Profile : http://community.jboss.org/people/piotr.sobczyk
Message:
--------------------------------------------------------------
> You write "In JBoss Tools project there is no problem" I assume you mean in a seam-gen project there is no problem ?
Yeah, obviously I meand "seam-gen project". Sorry for mistake.
> So what is the problem you are seeing in JBoss Tools ? You have noticed
> that both /hot and /main ends up in /classes too, making /dev simply a
> redundant one which you doesn't get used when deployed ?
No, no. I guess I wasn't too clear. The problem is that while Seam is in debug="false" mode hot deployment is disabled and classes inside WEB-INF/dev are not visible inside Seam application (ClassNotFound exceptions occur). However classes from main are still deployed by JBoss Tools to WEB-INF/classes and classes from hot are still deployed to WEB-INF/dev when debug is set to false. To adress this problem I could move all classes from hot to main before deployment so that all classes will end up in WEB-INF/classes (instead WEB-INF/dev). But moving files in project back and forth between hot and main source directories when every time I want to switch debug mode is quite problematic to say the least.
Is there any way to tell JBoss Tools: "Now I'm using debug mode so you should deploy classes from hot source directory to WEB-INF/classes instead of WEB-INF/dev"?
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/523057#523057
15 years