[JBoss Microcontainer Development] New message: "Re: VFS3 and symlinks"
by Jason Greene
JBoss development,
A new message was posted in the thread "VFS3 and symlinks":
http://community.jboss.org/message/528926#528926
Author : Jason Greene
Profile : http://community.jboss.org/people/jason.greene@jboss.com
Message:
--------------------------------------------------------------
> johnbailey wrote:
>
> After discussing with Jason on IRC, it seems any behavior related to symbolic link support would really have to rely in the FileSystem instances. The FileSystem instances may need to support symbolic links in different ways, or not at all. Handling symbolic links in the VFS or VirtualFile classes would break certain functionality allowing FileSystems to be mounted at any path.
>
> Ex.
> RealPath --> /real/path/to/archive.jar
> SymLinkedPath --> /link/to/archive.jar ('link' is symlink to /real/path)
>
> If you mount mount any FileSystem (maybe real, zip, assembled ...) at '/link' in the VFS, regardless of if it has anything to do with 'archive.jar', it would not be possible to get to the contents of the FileSystem if you force paths to be canonical in the VFS or VirtualFile layer. It would take the VFS path and convert it to the canonical path, and never get to the mounted FileSystem. In essence, the FileSystem does not exist in the VFS.
>
> What would make sense is if you asked a RealFileSystem for a specific path and it does the JDK File based canonical path conversion automatically. There may not necessarily be any other FileSystem that supports it, but there is nothing stopping a specific FileSystem from adding support.
>
> So I think it just makes sense to make sure we aren't switching between path types, and just leave it to the FileSystems to support it.
Where symlinks on vfs really break down is relative paths. If you have a symlink in a mount's root that points to "../sibling.jar", then it should refer to the parent of the mount in VFS. Unfortunately we don't know what a symlink points to since java doesn't know. If we could, however, read the link (say via an lstat call), it would be possible to canonicalize them correctly. We could bundle a JNI module that would allow for RealFileSystem to pull the link info, however, that would be a big effort for an uncommon feature. IMO we should wait to see if there is demand for it, and add it later.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/528926#528926
14 years, 9 months
[JBoss Microcontainer Development] New message: "Re: VFS3 and symlinks"
by John Bailey
JBoss development,
A new message was posted in the thread "VFS3 and symlinks":
http://community.jboss.org/message/528890#528890
Author : John Bailey
Profile : http://community.jboss.org/people/johnbailey
Message:
--------------------------------------------------------------
After discussing with Jason on IRC, it seems any behavior related to symbolic link support would really have to rely in the FileSystem instances. The FileSystem instances may need to support symbolic links in different ways, or not at all. Handling symbolic links in the VFS or VirtualFile classes would break certain functionality allowing FileSystems to be mounted at any path.
Ex.
RealPath --> /real/path/to/archive.jar
SymLinkedPath --> /link/to/archive.jar ('link' is symlink to /real/path)
If you mount mount any FileSystem (maybe real, zip, assembled ...) at '/link' in the VFS, regardless of if it has anything to do with 'archive.jar', it would not be possible to get to the contents of the FileSystem if you force paths to be canonical in the VFS or VirtualFile layer. It would take the VFS path and convert it to the canonical path, and never get to the mounted FileSystem. In essence, the FileSystem does not exist in the VFS.
What would make sense is if you asked a RealFileSystem for a specific path and it does the JDK File based canonical path conversion automatically. There may not necessarily be any other FileSystem that supports it, but there is nothing stopping a specific FileSystem from adding support.
So I think it just makes sense to make sure we aren't switching between path types, and just leave it to the FileSystems to support it.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/528890#528890
14 years, 9 months
[JBoss Tools Development] Document updated/added: " How to Use HSQL Database with JBossTools Right Way"
by Denis Golovin
JBoss development,
The document " How to Use HSQL Database with JBossTools Right Way", was updated Feb 26, 2010
by Denis Golovin.
To view the document, visit:
http://community.jboss.org/docs/DOC-14885#cf
Document:
--------------------------------------------------------------
You have several http://hsqldb.org/web/hsqlDocsFrame.htmlhttp://hsqldb.org/web/hsqlDocsFra.... I would chouse from couple described below:1. In process - by pointing out to local folder during creating DTP Connection Profile
2. Server - by starting it outside eclipse using command line and then create DTP Connection Profile with local server
h2. In Process Option
If you use "in process" option you have to be aware that it is not enough just point out folder where your database is located in connection properties. You have to add one more segment to it with database name or your DB will be empty (see explanation below).
For example you have HSQL DB somewhere on disk with name "employee". Im my case I have it downloaded from https://svn.jboss.org/repos/jbosstools/trunk/documentation/development/us... and just moved all files to local directory /home/eskimo/db/employee. So I have in this folder structure showed below (ignore employee.lck file it will be created after first "In process" start and not needed initially)
http://community.jboss.org/servlet/JiveServlet/showImage/2175/hsql-db-str...
I assume you you have the same but you need to correct all paths "/home/eskimo/db/employee" and database name "employee" with yours real values.
Then create "Database Connection" in DTP "Data Source Explorer" View by selecting "New..." from context menu on "Database Connections" node like
http://community.jboss.org/servlet/JiveServlet/showImage/2176/hsql-new-co...
Then select "HSQLDB" connection type and enter DB name as "employee"
http://community.jboss.org/servlet/JiveServlet/showImage/2177/hsql-new-co...
Then I assume you already have configured HSQL JDBC Driver and all what you need to is enter database name again as "employee" and select its location. After that one magic step is needed (it could be DTP issue). Add one more segment in "Database Location" like "/employee" like it shown below. Do not forget clear "Connect when wizard completes" checkbox because it will start In Process HSQL after wizard is finished and create employee.lck file in your database folder. This file will be the reason Seam why Seam Entity Generation wizard will fail during execution.
http://community.jboss.org/servlet/JiveServlet/showImage/2178/hsql-new-co...
Press Finish and check that employee node created under "Database Connections".
Now you're ready to create Seam Web project using "New Seam Web Project" wizard like it shown below (it shows only first and last steps because all other steps I left unchanged with default values).
http://community.jboss.org/servlet/JiveServlet/showImage/2179/seam-new-1.png
Then comes screens I left unchanged and finally you get to last one with seam configuration. You should have seam 2.1 configured and all what you need is to fill Database properties like it shown below and press "Finish".
http://community.jboss.org/servlet/JiveServlet/showImage/2180/seam-new-2.png
After wizard is finished you should see two projects prj1 and prj1-test in your workspace. Now to be ready for entities reverse engineering from your database you need to be sure hsqldb.jar is available in your Server classpath container or in prj1/WebContent/WEB-INF/lib folder. If you don't have hsqldb.jar there "Generate Seam Entities" will fail with ClassNotFound Exception, because it will not be able to find HSQL JDBC driver class.
Now you're ready to go. Switch to Seam Perspective and select "Generate Seam Entiies" from context menu on prj1 project
http://community.jboss.org/servlet/JiveServlet/showImage/2182/seam-gen-en...
Leave first step unchanged like it shown below and press "Next"
http://community.jboss.org/servlet/JiveServlet/showImage/2183/seam-gen-en...
On second step press "Refresh" button and make sure it shows all tables form database as it shown below. If there are no tables most likely HSQL connection is not correctly configured. To generate Seam Entities and xhtml pages press "Finish".
http://community.jboss.org/servlet/JiveServlet/showImage/2184/seam-gen-en...
You should get bunch of generated classes in source folder and pages in WebContent.
h2. Server Option
You need to start HSQL as Server first using command line. Open console and change your directory to database directory like
$ cd /home/eskimo/db/employee
Then start HSQL server in Server Mode like
$java -cp /home/eskimo/Java/hsqldb/lib/hsqldb.jar org.hsqldb.Server
You should see output like
[Server@19106c7]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@19106c7]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@19106c7]: Startup sequence initiated from main() method
[Server@19106c7]: Loaded properties from [/home/eskimo/db/employee/server.properties]
[Server@19106c7]: Initiating startup sequence...
[Server@19106c7]: Server socket opened successfully in 8 ms.
[Server@19106c7]: Database [index=0, id=0, db=file:employee, alias=] opened sucessfully in 690 ms.
[Server@19106c7]: Startup sequence completed in 699 ms.
[Server@19106c7]: 2010-02-25 13:37:54.016 HSQLDB server 1.8.1 is online
[Server@19106c7]: To close normally, connect and execute SHUTDOWN SQL
[Server@19106c7]: From command line, use [Ctrl]+[C] to abort abruptly
It starts by default in silent mode. If you want to see what's going one just change property +server.silent+ in server.properties file from +true+ to +false+ and your output will look like
[Server@34a1fc]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@34a1fc]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@34a1fc]: Startup sequence initiated from main() method
[Server@34a1fc]: Loaded properties from [/home/eskimo/db/employee/server.properties]
[Server@34a1fc]: [Thread[main,5,main]]: start() entered
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: run() entered
[Server@34a1fc]: Initiating startup sequence...
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.tls=false
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.port=1701
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.trace=false
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.database.0=employee
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.restart_on_shutdown=false
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.no_system_exit=false
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.silent=false
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.default_page=index.html
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.address=0.0.0.0
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.dbname.0=
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: server.root=.
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: openServerSocket() entered
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: Got server socket: ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=1701]
[Server@34a1fc]: Server socket opened successfully in 4 ms.
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: openServerSocket() exiting
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: openDatabases() entered
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: Opening database: [file:employee]
[Server@34a1fc]: Database [index=0, id=0, db=file:employee, alias=] opened sucessfully in 696 ms.
[Server@34a1fc]: [Thread[HSQLDB Server @34a1fc,5,main]]: openDatabases() exiting
[Server@34a1fc]: Startup sequence completed in 701 ms.
[Server@34a1fc]: 2010-02-25 13:41:49.516 HSQLDB server 1.8.1 is online
[Server@34a1fc]: To close normally, connect and execute SHUTDOWN SQL
[Server@34a1fc]: From command line, use [Ctrl]+[C] to abort abruptly
[Server@34a1fc]: [Thread[main,5,main]]: start() exiting
Starting HSQL as Servers you should not worry about employee.lck anymore and can leave "Connect when wizard completes" checkbox selected during creating new HSQL Database Connection, but Database Location should be changed to +hsql://localhost:1701+ in second step of "New Database Connection" Wizard like
http://community.jboss.org/servlet/JiveServlet/showImage/2185/hsql-new-co...
Thanks Denis,
I appreciate.
Best Regards,
Salim OFLAZ
This article was generated from the following thread: http://community.jboss.org/thread/148426
--------------------------------------------------------------
14 years, 9 months
[JBoss Microcontainer Development] New message: "DeclaredStructure Deployer and Mounting Archives"
by John Bailey
JBoss development,
A new message was posted in the thread "DeclaredStructure Deployer and Mounting Archives":
http://community.jboss.org/message/528820#528820
Author : John Bailey
Profile : http://community.jboss.org/people/johnbailey
Message:
--------------------------------------------------------------
JIRA --> https://jira.jboss.org/jira/browse/JBDEPLOY-242
In order for the DeclaredStructure structure deployer to work correctly with archive, the archive must be mounted in order for the META/jboss-structure.xml to be available. The fix is making the DeclaredStructure extendAbstractVFSArchiveStructureDeployer to ensure the archive is mounted prior to the execution of the determineStructure method.
This works for a simple case of a JAR or WAR as a top-level deployment. Where it becomes an issue is when the top-level deployment is an EAR and it declares its structure. This works to build the structure, but causes problems down the road as the nested archives are not actually mounted, and it will result in invalid deployments.
What needs to happen in this case is any top-level deployments that declare their structure, need to ensure the child deployment archives are mounted.
Haven't had time to work through the details yet, but I will be looking to add some tests to highlight the issue.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/528820#528820
14 years, 9 months