Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
- Seam 2.0 Beta + JBossas 4.2.1.GA + JBossWS-2.0.0.GA

- Seam 2.0 Beta + JBossas 4.2.1.GA + JBossWS-2.0.0.GA

2007-07-12       - By PatrickMadden

 Back
This is just a quick note to say that I'm successfully runing Seam 2.0 Beta
with the JBoss 4.2.1.GA from SVN and JBossWS-2 (See http://sWS-2.ora-code.com).0.0.GA also from SVN.

I was having real problems running web services on client side java
applications and Java Web Start applications connecting to my Seam Web
Application. (we have multiple views into the data)

I mainly followed the instructions found here:

http://jbws.dyndns.org/mediawiki/index.php?title=Building_From_Source


On July 7, I downloaded the Branch_4_2 of the JBoss Application server and
built it with JDK 1.5_12 (it fails to build on JDK 1.6). I then checked out the
JBossWS 2.0 and built it with jdk1.6u2.

When building jbossws you cd into the build directory and set two properties in
ant.properties. Mine are as follows:

anonymous wrote :
 | jboss42.home=c:/apps/jboss/jboss-4 (See http://oss-4.ora-code.com).2.1.GA
 | jbossws.integration.target=jboss42
 |

Inside the build directory there is also a build.conf file where you can tell
it to use JDK 6
anonymous wrote :
 | ##
 | ## Build configuration
 | ##
 |
 | # Uncomment when using JDK 6
 | USE_JDK6=true
 |

Then you use the build.bat file to build everything. Once its built you CD into
the jbossws-core directory and type:
anonymous wrote :
 | ant deploy-jboss42
 |

This deploys everything to the JBoss-4 (See http://oss-4.ora-code.com).2.1 directory and most importantly adds
important jar files to the JBoss-4 (See http://oss-4.ora-code.com).2.1\lib\endorsed directory

To get everything working on the client side you also need the endorsed jar
files to be properly set using the system property -Djava.endorsed.dirs

For me and my Java Web Start Applications I created a jar file called endorsed
.jars (jar'd all files in jboss endorsed directory) and download and unzip this
jar file during runtime into the java.home/lib/endorsed directory if they don't
exist already. If the don't exists already I notify the user that I did some
first time client side setup and then shutdown my application and automatically
relaunch it using the java.lang.ProcessBuilder Source code of java.lang.ProcessBuilder class. This is because the
endorsed jar files must be there before your JRE starts up. If they do exist my
app just continues normally and I can call all my web services on the backend.

Not all code is shown but its goes something like this:


 |         // Setup the Endorsed Directories        
 |                        
 |         String currentEndorsedDirs = System.getProperty("java.endorsed.dirs
");
 |         File endorsedJRELibDir = new File(currentEndorsedDirs);
 |         boolean unzipEndorsedJars;
 |        
 |         if (!endorsedJRELibDir.exists())
 |         {
 |             endorsedJRELibDir.mkdirs();
 |             unzipEndorsedJars = true;
 |         }
 |         else
 |         {
 |             // check to see if it has the proper jar files in it
 |             unzipEndorsedJars = true;
 |             File[] files = endorsedJRELibDir.listFiles();
 |            
 |             if (files != null)
 |             {
 |                 for (File file : files)
 |                 {
 |                     if (file.getName().equals("jboss-jaxws.jar"))
 |                     {
 |                         // ok we are fine
 |                         unzipEndorsedJars = false;
 |                         break;
 |                     }
 |                 }
 |             }
 |            
 |         }
 |        
 |         if (unzipEndorsedJars)
 |         {
 |             URL endorsedJarURL = new URL(System.getProperty("ContextRoot")
+ "desktop/lib/endorsed.jar");
 |             JarInputStream jarIn = new JarInputStream(endorsedJarURL
.openStream());  
 |            
 |             // unzip the file into jre's lib/endorsed directory - unzip
closes the input stream.
 |             ZipUtils.unzip(endorsedJRELibDir, jarIn);
 |         }                                              
 |        
 |         boolean addSubDirs = false;
 |         ClassPathModifier.addFiles(endorsedJRELibDir, addSubDirs);    
 |        
 |         if (unzipEndorsedJars)
 |         {
 |             JOptionPane.showMessageDialog(null,
 |               "We have detected that this is the first time you\n" +
 |               "have run the Clooster Desktop application with the\n"+
 |               "current Java Runtime environment.\n\n" +
 |               "As such, we have performed some initial client side\n"+
 |               "setup and the application needs to restart.",
 |               "Clooster, Inc",
 |               JOptionPane.PLAIN_MESSAGE);
 |            
 |            
 |             ProcessBuilder pb = new ProcessBuilder("javaws",
 |                     System.getProperty("ContextRoot") + "cloosterDesktop
.jnlp");
 |             pb.start();
 |            
 |             System.exit(0);            
 |         }
 |

This way even if the JRE is updated, my endorsed directories will be just fine.

I'm just posting this because I was pulling my hair out trying to get the
webservices running on JRE 1.6 on the client. JRE 1.6 adds extra code that
conflicts with the JBoss Web Services and thankfully using endorsed mechanism
there is a workaround.

Hope this helps anyone else who is pulling their hair out right now. BTW, have
not had any seam related issues at all using the new web services and 4.2.1.GA
build from SVN.

In case anyone is curious the ContextRoot property comes from the JNLP file as
follows:

<property name="ContextRoot" value="$$codebase"/>

One other thing - when compiling your web services client side code with jdk 1
.6u2 you need to tell javac ant task about the jboss endorsed jar files. This
can be done using a little trick as follows:


 |     <target depends="init" name="build-project">
 |         <echo message="${ant.project.name}: ${ant.file}"/>
 |         <property name="jbEndorsed" value="-endorseddirs ${jboss.endorsed}"
/>
 |         <javac debuglevel="${javac.debuglevel}" debug="${javac.debug}"
destdir="bin" source="${source}" target="${target}">
 |             <src path="src"/>
 |             <classpath refid="JBossClient.classpath"/>
 |             <compilerarg line="${jbEndorsed}" />
 |         </javac>
 |     </target>
 |

where jboss.endorsed in my case equals c:\apps\jboss\jboss-4 (See http://oss-4.ora-code.com).2.1.GA\lib
\endorsed. Otherwise you get build errors.



Thanks,

PVM

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic
&p=4063323#4063323

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4063323
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.