[Microcontainer] - Re: Inputs to deployers
by alesj
"jaikiran" wrote :
| So what is the expected behaviour of setInput(Class<?> clazz). If it was intended to use the classname as the attachment key, then any reason why the API expects a Class<?> instead of a String?
|
To help us with generic usage.
In most cases real deployers are meant to be component deployers,
where we expect only a single attachment by that type,
hence we are able to store it under class name.
It can also be used if you're aware that there will be only single
deployer storing its attachment under that class name.
I agree here with you that this might not be completely obvious,
hence you must use caution and common sense on when you use this single input. ;-)
"jaikiran" wrote :
| Also, how does the addInput API influence the deployers?
|
It helps with the "natural" order (order by inputs/outputs).
It might also help with something you wanted - AbstractAllInputDeployer.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238489#4238489
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4238489
16 years, 10 months
Doc about jboss5 deployment descriptors and "Unable to process deployment descriptor"
by Olivier Cailloux
Dear list,
I am currently learning J2EE development using the sun tutorial
[http://java.sun.com/javaee/6/docs/tutorial/doc/bnadx.html]. But instead
of using sun's enterprise server, I would like to learn to use JBoss.
I have read JBoss "Installation and Getting Started Guide"
[https://www.jboss.org/community/docs/DOC-12923] and had a look on the
"Administration and Configuration Guide"
[https://www.jboss.org/community/docs/DOC-12927] for JBoss 5.0.0GA
(links found here [http://www.jboss.org/jbossas/docs/index.html]).
However, I don't find a good doc about jboss specific deployment
descriptors, e.g. jboss-web.xml for a war. Altough naturally possible to
find some informations using Google, I would appreciate being able to
refer to an official doc as good and complete as the Administration and
Configuration Guide. Apparently there was some information available
for jboss4
[http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html]...
But not for the 5th version.
I also have a problem with a very simple example I am trying to deploy
on jboss5. I built a war containing:
0-21h05-~/Programmation/eclipse/web1/target$jar -tf web1-0.0.1-SNAPSHOT.war
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/classes/
WEB-INF/jboss-web.xml
index.html
The jboss-web.xml contains:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
<jboss-web>
<context-root>web1</context-root>
</jboss-web>
But when moving the .war file to the jboss deploy dir (hot deploying
it), the server says:
20:34:32,280 INFO [TomcatDeployment] undeploy, ctxPath=/web1-0.0.1-SNAPSHOT
20:34:32,355 INFO [TomcatDeployment] deploy, ctxPath=/web1-0.0.1-SNAPSHOT
20:34:32,428 WARNING [config] Unable to process deployment descriptor
for context '/web1-0.0.1-SNAPSHOT'
20:34:32,428 INFO [config] Initializing Mojarra (1.2_12-b01-FCS) for
context '/web1-0.0.1-SNAPSHOT'
The application works (i.e., I can see the content of the index.html
file when browsing to the /web1-0.0.1-SNAPSHOT context), but why does
jboss reject my context-root specification?
Thank you for any pointer or help.
Olivier
16 years, 10 months
[Microcontainer] - Inputs to deployers
by jaikiran
I am trying to understand the usage of setInput()/setInputs()/addInput() APIs on the deployers:
| public void setInput(Class<?> input)
|
| public void setInputs(Set<String> inputs)
|
| public void setInputs(String... inputs)
|
| public void setInputs(Class<?>... inputs)
|
| public void addInput(String input)
|
| public void addInput(Class<?> input)
|
I thought i had understood the usage the last time Emanuel mentioned about this here http://www.jboss.org/index.html?module=bb&op=viewtopic&t=156725#4236298
But after seeing the behaviour of setInput(Class<?> input), i am not sure again. I tried this in a simple deployer:
| // Just a test deployer
| MyDeployer extends AbstractDeployer
| {
|
| MyDeployer()
| {
| // let's add a requirement on an attachment in the unit of type String.class
| setInput(String.class);
| }
| ...
| }
|
Then there was a different deployer which added a attachment of type String to the unit. However none of the units ever got passed to this deployer. So looking into the MC code, i see that the check for relevance does this:
| protected boolean isRelevant(Deployer deployer, DeploymentUnit unit, boolean isTopLevel, boolean isComponent)
| {
| ...
| if (deployer.isAllInputs() == false)
| {
| // No attachment for the input type
| Class<?> input = deployer.getInput();
| if (input != null && unit.getAttachment(input) == null)
| return false;
|
| }
| return true;
| }
|
deployer.getInput returns String.class which is passed to unit.getAttachment(String.class) which ultimately does this:
| public <T> T getAttachment(Class<T> type)
| {
| if (type == null)
| throw new IllegalArgumentException("Null type");
| return getAttachment(type.getName(), type);
| }
|
The code finally ends up looking for an attachment with the name "java.lang.String" key. So unless the unit has an attachment with the key named "java.lang.String" the deployer is not going to be called.
So what is the expected behaviour of setInput(Class<?> clazz). If it was intended to use the classname as the attachment key, then any reason why the API expects a Class<?> instead of a String?
Also, how does the addInput API influence the deployers?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238485#4238485
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4238485
16 years, 10 months
[Security & JAAS/JBoss] - JBoss SSO not able to build the src folder..
by nikhilg
I downloaded the src bundle for SSO from
http://www.jboss.org/jbosssso/downloads/.
and following the steps mentioned in wiki article at:
http://www.jboss.org/community/wiki/StartFedSSO
I am getting error while executing following steps:
anonymous wrote : If the src bundle is downloaded, perform the following build steps by going to
| build (will build the project)
| | build installSSO (will install the JBoss Federated SSO binaries into the JBoss Application Server
Error message:
C:\jboss-sso-1.0CR1\components\build>build
Executing C:\jboss-sso-1.0CR1\components\build\..\tools\bin\ant.bat -logger org
.apache.tools.ant.NoBannerLogger
Exception in thread "main" java.lang.NoClassDefFoundError: Files\Java\jdk1/5/0_1
6\lib\tools/jar;C:\jboss-sso-1/0CR1\components\build\//\tools\lib\xml-apis/jar;C
:\jboss-sso-1/0CR1\components\build\//\tools\lib\xercesImpl/jar;C:\jboss-sso-1/0
CR1\components\build\//\tools\lib\xalan/jar;C:\jboss-sso-1/0CR1\components\build
\//\tools\lib\saxon/jar;C:\jboss-sso-1/0CR1\components\build\//\tools\lib\option
al/jar;C:\jboss-sso-1/0CR1\components\build\//\tools\lib\junit/jar;C:\jboss-sso-
1/0CR1\components\build\//\tools\lib\explode/jar;C:\jboss-sso-1/0CR1\components\
build\//\tools\lib\crimson/jar;C:\jboss-sso-1/0CR1\components\build\//\tools\lib
\buildmagic-tasks/jar;C:\jboss-sso-1/0CR1\components\build\//\tools\lib\bsf/jar;
C:\jboss-sso-1/0CR1\components\build\//\tools\lib\ant/jar;
Press any key to continue . . .
Same with the second step too.
When I opened this Jboss SSO src folder in eclipse. I found some build errors:
anonymous wrote : CookiePolicy.RFC_2109 cannot be resolved TokenValidationTestCase.java components/jboss_sso_test/src/main/test/jboss/security/token line 48 Java Problem
| Syntax error on token "}", AnnotationTypeDeclarationHeader expected after this token Enum.java components/build/ide/intellij/idea50/config/fileTemplates/internal line 4 Java Problem
| Syntax error on token "Invalid Character", @ expected AnnotationType.java components/build/ide/intellij/idea50/config/fileTemplates/internal line 1 Java Problem
| Syntax error on token "Invalid Character", @ expected Class.java components/build/ide/intellij/idea50/config/fileTemplates/internal line 1 Java Problem
| Syntax error on token "Invalid Character", @ expected Enum.java components/build/ide/intellij/idea50/config/fileTemplates/internal line 1 Java Problem
| Syntax error on token "Invalid Character", @ expected Interface.java components/build/ide/intellij/idea50/config/fileTemplates/internal line 3 Java Problem
| Syntax error on token "package", enum expected AnnotationType.java components/build/ide/intellij/idea50/config/fileTemplates/internal line 2 Java Problem
| The type $ is already defined AnnotationType.java components/build/ide/intellij/idea50/config/fileTemplates/internal line 4 Java Problem
|
| etc..
|
please guide me how to install SSO properly.
I am not seeing any place in this wiki where one has to make changes in JBoss server on which web/ear application would be running.
I am using following setup with this JBoss SSO:
Java : jdk1.5.0_16
JBoss : jboss-4.2.3.GA
Ant : Apache Ant version 1.7.0
Please provide ur suggestion
NIkhil
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238484#4238484
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4238484
16 years, 10 months
[JBoss Cache: Core Edition] - Re: Manual node locking?
by tomstrummer
"mircea.markus" wrote :
| anonymous wrote : But the DummyTransactionManager says it synchronizes in-memory only, so cache clients on two different machines wouldn't be sync'd.
| |
| what that means is that locks will be acquired on the node on which the tx was initiated only. If you have n1 and n2, two nodes in an replicated cluster,
| and an transaction having a write lock (WL) on fqn_1 on n1, then same fqn_1 is not locked on n2. In other words, transactions only aquire local locks. Locks are acquired on n2 only at commit time: at this point all operations performed on n1 will be executed in same sequence on n2 (including lock acquisition).
Unfortunately that doesn't sound like it will work for me... The locking API assumes that once you pass the lock() call, you have exclusive access to those resources... So that's very different from attempting to commit changes on implicitly shared resources.
"mircea.markus" wrote :
| If you need eager remote locking (i.e. acquire locks on all nodes of a cluster at write time) I suggest you to take a look at infinispan: http://www.jboss.org/infinispan
A grid computing solution? That sounds like a bit overkill... Could you point to an example of how this would work?
I'm going to try my put() method, which would work something like this:
To lock object O:
1. val = cache.put( '/locks', O, 'lock' )
2a. If val == null, we have the lock (no previous 'put')
2b. Else (val != null ) somebody else locked it first. Use a cache listener to wait for removed nodes
3a. Lock owner in (2a) proceeds. When finished, call cache.remove( '/locks', O )
3b. Contenders from (2b) get notified and return to (1)
Does that sound like it will work? Since it's a put, the operations will acquire a write lock, and subsequently (I assume) guarantees that two concurrent puts could no both return 'null' for the previous value.
What do you think? My other option would be to fall back to ZooKeeper, since I know that works :) But I really don't want to use 3 different frameworks in order to accomplish this :)
Thanks.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238472#4238472
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4238472
16 years, 10 months
[JBoss Messaging] - Ordering Group and Queue-FullSize reload problem
by mclu
Hi Howard!
Again me with a JBM OrderingGroup BUG.
Using newest Build of 1.4.5 (7304)
My test scenario:
- Client adds 500 Messages (Text with incrementing number) to a Queue.
- The Queue is set to
<attribute name="FullSize">50</attribute>
| <attribute name="PageSize">25</attribute>
| <attribute name="DownCacheSize">25</attribute>
- The handler is slower than the producer.
- On receiving side I see well ordered messages.
like:
...
| 14:20:12,234 INFO [TestMessageHandlerBean] Got:176 mID:ID:JBM-475cc9ad-cbf7-4039-9fb5-8edf19d3d3c1
| 14:20:12,250 INFO [TestMessageHandlerBean] Got:177 mID:ID:JBM-f9f56a49-5d82-453a-80c7-9d850d090f73
| 14:20:12,265 INFO [TestMessageHandlerBean] Got:178 mID:ID:JBM-657effd8-3099-47bc-887c-fd4289009635
| ...
But if I kill jboss while it handles the 500 messages (lets say at message 100) and restart it I see the following:
The rest(400) of the 500 Messages are in the Queue!
While starting jboss up the messaging system reloads the messages from the database. I can see that inside the table the first 50 messages have page_ord null and the others incrementing numbers.
Then it starts handling by continue at the last message.
101, 102, 103 and so on.
But while reloading messages after the fullsize barrier the order is scambled.
On my first test only one message/number was missing which was handled then after message 500
My second test all messages are fine and in order
My third test results in:
...
| 14:20:16,265 INFO [TestMessageHandlerBean] Got:208 mID:ID:JBM-c3d5eaa5-01aa-48de-b37d-f193f203fb49
| 14:20:16,296 INFO [TestMessageHandlerBean] Got:209 mID:ID:JBM-b0e4841c-4acb-487d-9c89-d0fa7045bb7e
| 14:20:16,328 INFO [TestMessageHandlerBean] Got:210 mID:ID:JBM-1a451bc1-c8a6-43f8-9bb6-e070fff2942a
| 14:20:16,343 INFO [TestMessageHandlerBean] Got:492 mID:ID:JBM-64b01947-59fb-4404-8e3a-3cae255fb91f
| 14:20:16,343 ERROR [TestMessageKeeper] Number sequence is not ok. Expected 211 but was:492
| 14:20:16,359 ERROR [TestMessageKeeper] Resetting to:492
| 14:20:16,375 INFO [TestMessageHandlerBean] Got:493 mID:ID:JBM-018565ac-4ed3-453c-84fb-14b7251062a4
| 14:20:16,421 INFO [TestMessageHandlerBean] Got:494 mID:ID:JBM-cfc1f42b-6c5d-4309-8e71-d3c39cd91866
| 14:20:16,453 INFO [TestMessageHandlerBean] Got:495 mID:ID:JBM-2f052b3a-e2c7-4c58-9615-b3bd299e8d9f
| 14:20:16,468 INFO [TestMessageHandlerBean] Got:496 mID:ID:JBM-42841e9f-cd32-4aa9-89d7-d0232edc9987
| 14:20:16,500 INFO [TestMessageHandlerBean] Got:497 mID:ID:JBM-aaf28cb8-6f1c-4e86-aac6-cee850440801
| 14:20:16,531 INFO [TestMessageHandlerBean] Got:498 mID:ID:JBM-cdfac31d-3b21-497a-8e44-c649c4aead0c
| 14:20:16,531 INFO [TestMessageHandlerBean] Got:499 mID:ID:JBM-3a2226c1-6375-49b9-baed-ca1945b41e02
| 14:20:16,562 INFO [TestMessageHandlerBean] Got:500 mID:ID:JBM-0e720c52-1eb9-4b77-9596-9d78e31031ff
| 14:20:16,578 INFO [TestMessageHandlerBean] Got:211 mID:ID:JBM-20ccaeca-f409-455a-b3b4-69519fd065e2
| 14:20:16,578 ERROR [TestMessageKeeper] Number sequence is not ok. Expected 501 but was:211
| 14:20:16,578 ERROR [TestMessageKeeper] Resetting to:211
| 14:20:16,640 INFO [TestMessageHandlerBean] Got:212 mID:ID:JBM-67d13844-da4b-4a75-a78c-707e7c1b0d9e
| 14:20:16,718 INFO [TestMessageHandlerBean] Got:213 mID:ID:JBM-84831294-f9d5-431d-982d-38994135c978
| 14:20:16,765 INFO [TestMessageHandlerBean] Got:214 mID:ID:JBM-e99d350a-f824-42a8-9536-d265a0babc9b
| 14:27:34,453 INFO [TestMessageHandlerBean] Got:215 mID:ID:JBM-41c58e16-fda5-449f-b508-a7c65f1f3d6e
| ...
So it seams that the order is not garanteed anymore if the size of the queue exceeds the FullSize setting.
Is this a BUG?
By the way. I tested this Rollback Bug of OrderingGroup. This works now perferct! Good (and fast) Job :-)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238469#4238469
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4238469
16 years, 10 months