Re: [jboss-user] [JBoss Microcontainer Development POJO Server] - Implementing a non-flat deployment for Weld Integration
by Ales Justin
Ales Justin [http://community.jboss.org/people/alesj] replied to the discussion
"Implementing a non-flat deployment for Weld Integration"
To view the discussion, visit: http://community.jboss.org/message/546240#546240
--------------------------------------------------------------
The behavior should be deterministic / well-defined from the spec.
My guess is the previous behavior was correct, if not, then like you said, it's just a matter of fixing the tests.
But if it was correct, then your impl needs fixing in the following way -- actually a small change:
> Notice that, interestingly, in the way things are implemented today, if you pass one of the missing classes as a parameter to a Deployment.loadBeanDeploymentArchive, my implementation will return the requested BDA correctly, but still the BDA will lack the requested class!
== simply dynamically add the classes of requested class' owner jar to BDA's classes.
Even thought our "glue" for BDA mapping is CL, it doesn't mean they are 1:1.
And with that suggested fix I don't see the need for more fine grained mapping.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546240#546240]
Start a new discussion in JBoss Microcontainer Development POJO Server at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months
Re: [jboss-user] [JBoss Microcontainer Development POJO Server] - Implementing a non-flat deployment for Weld Integration
by Flavia Rainone
Flavia Rainone [http://community.jboss.org/people/flavia.rainone%40jboss.com] replied to the discussion
"Implementing a non-flat deployment for Weld Integration"
To view the discussion, visit: http://community.jboss.org/message/546238#546238
--------------------------------------------------------------
> Ales Justin wrote:
>
> > The loadBeanDeploymentArchive method solely exists for the case that someone adds a bean based on a class which isn't present in the BDA graph via a CDI lifecycle listener. For every bean defined in such a way, Weld calls loadBeanDeploymentArchive, expecting the correct BDA to be returned.
> > IOW this is a kinda a two stage process - firstly the BDAs which are defined declaratively (META-INF/beans.xml) are handed to Weld, and then BDAs which are defined programatically are loaded by Weld (via loadBeanDeploymentArchive).
> So, if I understand this correctly, BDAs created via "loadBeanDeploymentArchive" don't require beans.xml?
> Simply add the class' owner jar as a BDA archive?
I have just chatted with Pete, and this is what he has to say about it:
(11:43:25) Pete: so it looks like from what you say that the BDA you are returning from loadBDA is pre-populated with everything in that archive?
(11:44:00) Flavia: Yes, it has always been like this. The only difference is that a few classes were missing.
(11:45:59) Pete: hmm, I think the intention is to only have the classes in that BDA that have been explicitly requested via loadBDA
(11:46:07) Flavia: Aha!
(11:46:16) Flavia: That is a missing piece of the puzzle then
(11:46:18) Pete: (of course, if it's an existing BDA, then it should have the regular classes)
(11:47:14) Flavia: As I said in the forum, mapping a BDA to a ClassLoader
(11:47:26) Flavia: puts several jars in the same umbrella.
(11:47:54) Flavia: So, currently, the BDA "umbrella" for several jars contain only the classes of the jars that have the beans.xml file. Is this correct?
(11:48:02) Flavia: From the Weld point of view
(11:48:29) Pete: i think that sounds fine to me
(11:48:52) Flavia: Ok, so in that case, I think that Ales's suggestion is the way to go
(11:48:56) Flavia: Ales suggested a third option
(11:49:25) Flavia: According to Ales, what is there is correct the way it is, which is also what you are saying
(11:49:45) Flavia: The only thing here is that, if a loadBeanDeploymentArchive is invoked with a class that is not in the BDA before
(11:50:10) Flavia: considering the BDA already exists but one of the jars it represents lacks the META-INF/beans.xml file
(11:50:29) Flavia: in that case, the class should be added to the already existing BDA before it is returned
(11:51:25) Pete: i think in our case
(11:51:29) Pete: it depends on the classloader
(11:51:37) Pete: /Module
(11:51:52) Pete: if it's in a Module which already has an associated BDA, then add it to that BDA and return that BDA
(11:52:05) Pete: if it's in a Module with no BDA, create a new BDA with just that class in
(11:52:25) Flavia: Cool, that's easy to do
(11:52:59) Flavia: So, I should always add the class, and never start scanning the jar it belongs to in order to add all the classes to the BDA?
(11:53:31) Pete: for loadBDA, no, never
(11:53:42) Flavia: Aha! Now I think I get it
...
(11:55:05) Pete: basically, you can think of loadBDA as a special way of adding classes to BDA which only adds those classes
(11:55:24) Flavia: Yes... Ales and I were talking about this today on the call
(11:55:39) Flavia: His question is when, in which scenario, loadBDA is called for a class that is not in the BDA?
(11:55:44) Pete: ah
(11:55:53) Pete: well, if you look at CDI lifecycle events
(11:56:05) Pete: you can see that people can create a Bean<> for any class that is on the classpath
(11:56:14) Pete: so to properly enforce the accessibility rules
(11:56:21) Pete: we need to know where it is in the BDA graph
(11:56:56) Flavia: Hm... so you may end up needing to create a bean of a type that is not in the BDA
(11:57:05) Pete: exactly
So, in a nutshell, all I have to do is change DeploymentImpl.loadBDA() so it adds the Class to the BDA if the BDA it is returning lacks that class.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546238#546238]
Start a new discussion in JBoss Microcontainer Development POJO Server at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months
Re: [jboss-user] [JBoss Microcontainer Development POJO Server] - Implementing a non-flat deployment for Weld Integration
by Ales Justin
Ales Justin [http://community.jboss.org/people/alesj] replied to the discussion
"Implementing a non-flat deployment for Weld Integration"
To view the discussion, visit: http://community.jboss.org/message/546236#546236
--------------------------------------------------------------
> Yes. If there is an accessible (i.e. classes can be loaded from it) library jar with META-INF/beans.xml, then Weld expects you to return it as part of the BDA graph of the Deployment.
OK, this then rules out my lazy approach. :-)
But I would still do this on_demand, when (but just before) the first CDI/Weld deployment is deployed.
That would be the default behavior, but it could be made optional to do this at boot time instead.
> The loadBeanDeploymentArchive method solely exists for the case that someone adds a bean based on a class which isn't present in the BDA graph via a CDI lifecycle listener. For every bean defined in such a way, Weld calls loadBeanDeploymentArchive, expecting the correct BDA to be returned.
> IOW this is a kinda a two stage process - firstly the BDAs which are defined declaratively (META-INF/beans.xml) are handed to Weld, and then BDAs which are defined programatically are loaded by Weld (via loadBeanDeploymentArchive).
So, if I understand this correctly, BDAs created via "loadBeanDeploymentArchive" don't require beans.xml?
Simply add the class' owner jar as a BDA archive?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546236#546236]
Start a new discussion in JBoss Microcontainer Development POJO Server at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months
Re: [jboss-user] [Beginner's Corner] - problems with an EAR file with MDBs
by null null
null null [http://community.jboss.org/people/ranjix] replied to the discussion
"problems with an EAR file with MDBs"
To view the discussion, visit: http://community.jboss.org/message/546235#546235
--------------------------------------------------------------
Thanks for the answer, Jaikiran.
The 4 apps are very similar in the way they start (same code, different parameters), in the sense that they do contain a servlet (same servlet in each app) which should execute on startup. Indeed, the log messages are printed when the servlet finishes executing.
What's bothering is that I don't see any exceptions anywhere (jboss logs, our own apps logs), so it looks like besides having JBoss recognize that there is a WAR which should be deployed (line with the ctxPath), nothing else happens. Also, the introduction of the MDB seems to be the trigger for the issue. For a test, I commented out in the publish.ear/META-INF/application.xml the ejb module. After restarting the server, all of the apps start correctly - see log underneath. Putting back the ejb module in the application.xml takes me back to the strange behavior, in which only EAC seems to start.
*With the ejb module commented out in application.xml, everything starts ok.*
*
*
10:24:58,008 INFO [TomcatDeployment] deploy, ctxPath=/eac
10:24:59,469 INFO [STDOUT] Initializing application. (C:\10.DEV.NEW.3\modules\e
ac\config\eac.appconfig.dna)
10:25:03,356 INFO [STDOUT] Checking initialization state for database 'eac' (jd
bc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_EAC)...
10:25:04,264 INFO [STDOUT] URL optimisation mode set to: none
10:25:04,273 INFO [STDOUT]
**************************************************************************
Escalate Environment and Access Control successfully started
**************************************************************************
10:25:04,351 INFO [TomcatDeployment] deploy, ctxPath=/edesk
10:25:05,116 INFO [STDOUT] Initializing application. (C:\10.DEV.NEW.3\modules\c
ore\config\pdc.server.appconfig.dna)
10:25:05,281 ERROR [STDERR] Environment variable 'BMS_JMS_SERVER_NAME' missing f
or DNAList name 'server'
10:25:10,662 INFO [STDOUT] Could not find the 'startup' callback class 'com.blu
emartini.dev.net.DevServer'. Ignoring.
10:25:10,744 INFO [STDOUT] Checking initialization state for database 'main' (j
dbc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_MAIN)...
10:25:11,196 INFO [STDOUT] Checking initialization state for database 'store' (
jdbc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_STORE)...
10:25:12,185 INFO [STDOUT] URL optimisation mode set to: none
10:25:12,212 INFO [STDOUT] Initializing rules engine...
10:25:12,251 INFO [STDOUT] Rules engine successfully initialized...
10:25:12,319 INFO [STDOUT] SearchIndexLoader.init()
10:25:12,373 INFO [STDOUT] BM JMS: Creating Topic Connection to JMS Server jnp
://DB-SPOP:1099
10:25:13,136 INFO [STDOUT] BM JMS: Creating Queue Connection to JMS Server jnp
://DB-SPOP:1099
10:25:13,221 INFO [STDOUT] BM JMS: Successfully connected to JMS Server jnp://
DB-SPOP:1099
10:25:13,680 INFO [STDOUT]
**************************************************************************
Escalate Enterprise Desktop Server successfully started
**************************************************************************
10:25:13,753 INFO [TomcatDeployment] deploy, ctxPath=/jms
10:25:14,437 INFO [STDOUT] Initializing application. (C:\10.DEV.NEW.3\modules\j
ms\config\jms.appconfig.dna)
10:25:19,577 INFO [STDOUT]
**************************************************************************
Escalate JMS Server successfully started
**************************************************************************
10:25:19,678 INFO [TomcatDeployment] deploy, ctxPath=/publish
10:25:20,270 INFO [STDOUT] Initializing application. (C:\10.DEV.NEW.3\modules\p
ublish\config\publish.appconfig.dna)
10:25:20,430 ERROR [STDERR] Environment variable 'BMS_JMS_SERVER_NAME' missing f
or DNAList name 'server'
10:25:24,235 INFO [STDOUT] Could not find the 'startup' callback class 'com.blu
emartini.dev.net.DevServer'. Ignoring.
10:25:24,340 INFO [STDOUT] Checking initialization state for database 'main' (j
dbc:sqlserver://DB-SPOP:1433;SelectMethod=cursor;DatabaseName=jboss_MAIN)...
10:25:24,875 INFO [STDOUT] SearchIndexLoader.init()
10:25:25,227 INFO [STDOUT] BM JMS: Creating Topic Connection to JMS Server jnp
://DB-SPOP:1099
10:25:25,265 INFO [STDOUT] BM JMS: Creating Queue Connection to JMS Server jnp
://DB-SPOP:1099
10:25:25,291 INFO [STDOUT] BM JMS: Successfully connected to JMS Server jnp://
DB-SPOP:1099
10:25:25,389 INFO [STDOUT]
**************************************************************************
Escalate Publishing Server successfully started
**************************************************************************
10:25:25,641 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8
080
10:25:25,677 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
10:25:25,695 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8
443
10:25:25,712 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=
JBoss_5_1_0_GA date=200905221053)] Started in 1m:59s:111ms
I also wonder how does the MDB/EJB from the publish app interfere with the earlier start of another app (let's say JMS). I could see this happening if the JBoss server starts these apps somehow in parallel, with publish starting actually before jms finishing. If this is the case, is there any way to specify that I want these apps to start sequentially?
thanks for any suggestion/
ranjix
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546235#546235]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months
[JBoss Web Services] - Application exceptions namespace not correct in wsdl
by R K
R K [http://community.jboss.org/people/rkb76in] created the discussion
"Application exceptions namespace not correct in wsdl"
To view the discussion, visit: http://community.jboss.org/message/546230#546230
--------------------------------------------------------------
Doing development on JBoss [EAP] 4.3.0.GA_CP07 with Java version: 1.5.0_22,Sun Microsystems Inc.
Exposing webservices using Stateless EJB3
*Try 1*, My objects are like this
@XmlType(namespace="exception.item.common.xxxxx.org")
public class ApplicationException extends Exception {
....
}
@XmlType(namespace="item.common.xxxxx.org")
public class AppealId implements Comparable, Serializable {
......
}
ApplicationException, gets defined in the .wsdl as a complex type, but the @XmlType annotation information does not taken into account e.g. the type is defined in the wrong namespace.
AppealId, gets defined in the .wsdl as a complex type and @XmlType annotation information taken into account e.g. the type is defined in correct namespace.
I could generate classes using wsconsume.bat successfully (*Exceptions ending in wrong packages*.)
Try 2, My objects are like this
@XmlType(namespace="exception.item.common.xxxxx.org")
@WebFault(name="ApplicationException",targetNamespace="exception.item.common.xxxxx.org")
public class ApplicationException extends Exception {
....
}
@XmlType(namespace="item.common.xxxxx.org")
public class AppealId implements Comparable, Serializable {
......
}
ApplicationException, gets defined in the .wsdl as a complex type, but the @WebFault annotation information does not taken into account fully e.g. the type is defined in the wrong namespace.
AppealId, gets defined in the .wsdl as a complex type and @XmlType annotation information taken into account e.g. the type is defined in correct namespace.
But this time got this in .wsdl
<xs:schema targetNamespace="exception.item.common.xxxxx.org" version="1.0" xmlns:ns1=" http://ejb3.xxxxx.org/ http://ejb3.xxxxx.org/" xmlns:xs=" http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema">
<xs:import namespace=" http://ejb3.xxxxx.org/ http://ejb3.xxxxx.org/" />
<xs:element name="RemoteSystemFailedException" type="ns1:RemoteSystemFailedException" />
</xs:schema>
I couldn't generate classes using wsconsume.bat, got error message
[ERROR] Schema descriptor { http://ejb3.xxxxx.org/ http://ejb3.xxxxx.org/}RemoteSystemFailedException in message part "RemoteSystemFailedException" could not be bound to Java!
Help me please ...
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546230#546230]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months
[JBoss Portal Development] - Can not get JNDI connection from Data sourceSQLState with oracle 10g
by raju k
raju k [http://community.jboss.org/people/komariraj] created the discussion
"Can not get JNDI connection from Data sourceSQLState with oracle 10g"
To view the discussion, visit: http://community.jboss.org/message/546225#546225
--------------------------------------------------------------
Hi all
i am using jboss portal 2.6.8 server with oracle 10g..
i am getting follwing exception when creating datasource object for Oracle 10g using JNDI.
*Can not get JNDI connection from Data sourceSQLState: null Vendor Code: 0 Could not create connection; - nested throwable: (java.lang.NullPointerException); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.NullPointerException))*
*step-1: portal-oracle-ds.xml*
<datasources>
<local-tx-datasource>
<jndi-name>jndiname</jndi-name>
<connection-url>jdbc:oracle:thin:@server:orcl</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>user</user-name>
<password>password</password>
</local-tx-datasource>
</datasources>
I copied this xml file in to deploy folder of jboss.
*s**tep: 2* classes12.jar copied in my war file lib only
*
*
*step-3*: in my java code ...
line-1: InitialContext initialContext = new InitialContext();
line-2: DataSource dataSource = (DataSource)initialContext.lookup("java:/jndiname");
line-3: java.sql.Connection dbconnection = dataSource.getConnection();
when ever i am executing line-3, getting above exception...
if any body knows about this problam , please help...
Thanks in advance..
Raju.K
*
*
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546225#546225]
Start a new discussion in JBoss Portal Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months