[
http://jira.jboss.com/jira/browse/JBMICROCONT-286?page=all ]
Walid Gedeon updated JBMICROCONT-286:
-------------------------------------
Description:
This relates to the examples attached to the JBoss Microcontainer User Guide 2.0.0Beta9
(sorry, didn't find a matching version in the list).
In the commandLineClient sample, bus mode, Client cannot see Employee (which is defined in
one of the services, in this case humanResourcesService); therefore it throws a
NoClassDefFoundError when adding an employee.
The attached archive updates files in humanResourcesService:
- split service and beans into interface and implementation
- moved interfaces to org.jboss.example.service.common (including SalaryStrategy)
- added Address and Employee factory methods to HRService
- updated pom to produce secondary artifact for client-only dependency
- updated test case deployment descriptors to refer to HRServiceImpl
and in commandLineClient:
- Updated ConsoleInput to keep a copy of the Client and use it as a proxy to HRService
calls (namely factory methods)
- Added HRService factory proxy methods to Client
- Added isHiringFreeze() and getSalaryStrategy for homogenous proxy access
- Updated printStatus to use client methods for HRService access
- Updated config files to inject HRServiceImpl
- Updated assembly files to depend on main or secondary (client) artifacts, depending on
situation
- Added pom dependency to client artifact
- Updated test cases to use above changes
- Updated test cases deployment descriptors to inject HRServiceImpl
The archive contains the complete contents of those 2 subdirectories (changed and
unchanged files), if a diff-patch is preferred, it can be provided with an access to svn.
To update as is, replace directories commandLineClient and humanResourcesService with the
ones provided, no other updates required.
Error trace, for reference:
----
D:\...\commandLineClient\target\client-cl.dir>run.bat bus
Client DEBUG [06-05-2008 17:44:43] KernelFactory - Starting JBoss Kernel construction...
Client DEBUG [06-05-2008 17:44:43] KernelFactory - Completed JBoss Kernel construction.
Duration: 187 milliseconds
-----------------------------------
Menu:
d) Deploy Human Resources service
u) Undeploy Human Resources service
a) Add employee
l) List employees
r) Remove employee
g) Get a salary
s) Set a salary
t) Toggle hiring freeze
m) Display menu
p) Print service status
q) Quit
d
Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser - Created
parser: org.apache.xerces.jaxp.SAXParserImpl@64883c, isNam
espaceAware: true, isValidating: true, isXIncludeAware: true
Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser -
http://xml.org/sax/features/validation set to: true
Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser -
http://xml.org/sax/features/namespaces set to: true
Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser -
http://apache.org/xml/features/validation/dynamic set to: true
Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser - Using parser:
org.apache.xerces.jaxp.SAXParserImpl@64883c, isNames
paceAware: true, isValidating: true, isXIncludeAware: true
a
Please enter the employee's name [firstName lastName]:
first last
Exception in thread "Thread-1" java.lang.NoClassDefFoundError:
org/jboss/example/service/Employee
at org.jboss.example.client.ConsoleInput.getEmployee(ConsoleInput.java:108)
at org.jboss.example.client.Client.addEmployee(Client.java:94)
at org.jboss.example.client.ConsoleInput$1.run(ConsoleInput.java:54)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jboss.example.service.Employee
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 4 more
Client INFO [06-05-2008 17:44:59] EmbeddedBootstrap - Shutting down
----
was:
This relates to the examples attached to the JBoss Microcontainer User Guide 2.0.0Beta9
(sorry, didn't find a matching version in the list).
In the commandLineClient sample, bus mode, Client cannot see Employee (which is defined in
one of the services, in this case humanResourcesService); therefore it throws a
NoClassDefFoundError when adding an employee.
The attached archive updates files in humanResourcesService:<ul>
<li>split service and beans into interface and implementation</li>
<li>moved interfaces to org.jboss.example.service.common (including
SalaryStrategy)</li>
<li>added Address and Employee factory methods to HRService</li>
<li>updated pom to produce secondary artifact for client-only
dependency</li>
<li>updated test case deployment descriptors to refer to HRServiceImpl</li>
</ul>
and in commandLineClient:<ul>
<li>Updated ConsoleInput to keep a copy of the Client and use it as a proxy to
HRService calls (namely factory methods)</li>
<li>Added HRService factory proxy methods to Client</li>
<li>Added isHiringFreeze() and getSalaryStrategy for homogenous proxy
access</li>
<li>Updated printStatus to use client methods for HRService access</li>
<li>Updated config files to inject HRServiceImpl</li>
<li>Updated assembly files to depend on main or secondary (client) artifacts,
depending on situation</li>
<li>Added pom dependency to client artifact</li>
<li>Updated test cases to use above changes</li>
<li>Updated test cases deployment descriptors to inject HRServiceImpl</li>
</ul>
The archive contains the complete contents of those 2 subdirectories (changed and
unchanged files), if a diff-patch is preferred, it can be provided with an access to svn.
To update as is, replace directories commandLineClient and humanResourcesService with the
ones provided, no other updates required.
Error trace, for reference:
<pre>
D:\...\commandLineClient\target\client-cl.dir>run.bat bus
Client DEBUG [06-05-2008 17:44:43] KernelFactory - Starting JBoss Kernel construction...
Client DEBUG [06-05-2008 17:44:43] KernelFactory - Completed JBoss Kernel construction.
Duration: 187 milliseconds
-----------------------------------
Menu:
d) Deploy Human Resources service
u) Undeploy Human Resources service
a) Add employee
l) List employees
r) Remove employee
g) Get a salary
s) Set a salary
t) Toggle hiring freeze
m) Display menu
p) Print service status
q) Quit
d
Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser - Created
parser: org.apache.xerces.jaxp.SAXParserImpl@64883c, isNam
espaceAware: true, isValidating: true, isXIncludeAware: true
Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser -
http://xml.org/sax/features/validation set to: true
Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser -
http://xml.org/sax/features/namespaces set to: true
Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser -
http://apache.org/xml/features/validation/dynamic set to: true
Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser - Using parser:
org.apache.xerces.jaxp.SAXParserImpl@64883c, isNames
paceAware: true, isValidating: true, isXIncludeAware: true
a
Please enter the employee's name [firstName lastName]:
first last
Exception in thread "Thread-1" java.lang.NoClassDefFoundError:
org/jboss/example/service/Employee
at org.jboss.example.client.ConsoleInput.getEmployee(ConsoleInput.java:108)
at org.jboss.example.client.Client.addEmployee(Client.java:94)
at org.jboss.example.client.ConsoleInput$1.run(ConsoleInput.java:54)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jboss.example.service.Employee
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 4 more
Client INFO [06-05-2008 17:44:59] EmbeddedBootstrap - Shutting down
</pre>
> User Guide examples (gettingStarted), NoClassDefFoundError
> ----------------------------------------------------------
>
> Key: JBMICROCONT-286
> URL:
http://jira.jboss.com/jira/browse/JBMICROCONT-286
> Project: JBoss MicroContainer
> Issue Type: Patch
> Environment: Issue unrelated with environment, platform independent.
> Reporter: Walid Gedeon
> Attachments: userGuide-examples-gettingStarted-06052008.zip
>
>
> This relates to the examples attached to the JBoss Microcontainer User Guide
2.0.0Beta9 (sorry, didn't find a matching version in the list).
> In the commandLineClient sample, bus mode, Client cannot see Employee (which is
defined in one of the services, in this case humanResourcesService); therefore it throws a
NoClassDefFoundError when adding an employee.
> The attached archive updates files in humanResourcesService:
> - split service and beans into interface and implementation
> - moved interfaces to org.jboss.example.service.common (including SalaryStrategy)
> - added Address and Employee factory methods to HRService
> - updated pom to produce secondary artifact for client-only dependency
> - updated test case deployment descriptors to refer to HRServiceImpl
> and in commandLineClient:
> - Updated ConsoleInput to keep a copy of the Client and use it as a proxy to
HRService calls (namely factory methods)
> - Added HRService factory proxy methods to Client
> - Added isHiringFreeze() and getSalaryStrategy for homogenous proxy access
> - Updated printStatus to use client methods for HRService access
> - Updated config files to inject HRServiceImpl
> - Updated assembly files to depend on main or secondary (client) artifacts,
depending on situation
> - Added pom dependency to client artifact
> - Updated test cases to use above changes
> - Updated test cases deployment descriptors to inject HRServiceImpl
> The archive contains the complete contents of those 2 subdirectories (changed and
unchanged files), if a diff-patch is preferred, it can be provided with an access to svn.
To update as is, replace directories commandLineClient and humanResourcesService with the
ones provided, no other updates required.
> Error trace, for reference:
> ----
> D:\...\commandLineClient\target\client-cl.dir>run.bat bus
> Client DEBUG [06-05-2008 17:44:43] KernelFactory - Starting JBoss Kernel
construction...
> Client DEBUG [06-05-2008 17:44:43] KernelFactory - Completed JBoss Kernel
construction. Duration: 187 milliseconds
> -----------------------------------
> Menu:
> d) Deploy Human Resources service
> u) Undeploy Human Resources service
> a) Add employee
> l) List employees
> r) Remove employee
> g) Get a salary
> s) Set a salary
> t) Toggle hiring freeze
> m) Display menu
> p) Print service status
> q) Quit
>
d
> Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser -
Created parser: org.apache.xerces.jaxp.SAXParserImpl@64883c, isNam
> espaceAware: true, isValidating: true, isXIncludeAware: true
> Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser -
http://xml.org/sax/features/validation set to: true
> Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser -
http://xml.org/sax/features/namespaces set to: true
> Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser -
http://apache.org/xml/features/validation/dynamic set to: true
> Client DEBUG [06-05-2008 17:44:46] SaxJBossXBParser - Using parser:
org.apache.xerces.jaxp.SAXParserImpl@64883c, isNames
> paceAware: true, isValidating: true, isXIncludeAware: true
>
a
> Please enter the employee's name [firstName
lastName]:
> first last
> Exception in thread "Thread-1" java.lang.NoClassDefFoundError:
org/jboss/example/service/Employee
> at org.jboss.example.client.ConsoleInput.getEmployee(ConsoleInput.java:108)
> at org.jboss.example.client.Client.addEmployee(Client.java:94)
> at org.jboss.example.client.ConsoleInput$1.run(ConsoleInput.java:54)
> at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ClassNotFoundException: org.jboss.example.service.Employee
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> ... 4 more
> Client INFO [06-05-2008 17:44:59] EmbeddedBootstrap - Shutting down
> ----
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira