users@glassfish.java.net

Re: RE: JSP dataSource problem

From: <glassfish_at_javadesktop.org>
Date: Fri, 21 May 2010 00:43:48 PDT

Thank You for your reply,
the file is at $GF_HOME/domains/domain1/config/domain.xml I tried to change it to look like what You wrote here, but the server doesn`t start.
I think that You might dont realize whats the problem. I don`t need to configure persistance.xml, the persistence its already working.

<jdbc-connection-pool datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" res-type="javax.sql.DataSource" name="zetowr_at_energia" ping="true">
      <property name="AllowLoadLocalInfile" value="true" />
      <property name="AllowMultiQueries" value="false" />
      <property name="AllowNanAndInf" value="false" />
      <property name="AllowUrlInLocalInfile" value="false" />
      <property name="AlwaysSendSetIsolation" value="true" />
      <property name="AutoClosePStmtStreams" value="false" />
      <property name="AutoDeserialize" value="false" />
      <property name="AutoGenerateTestcaseScript" value="false" />
      <property name="AutoReconnectForPools" value="false" />
      <property name="AutoSlowLog" value="true" />
      <property name="BlobSendChunkSize" value="1048576" />
      <property name="BlobsAreStrings" value="false" />
      <property name="CacheCallableStatements" value="false" />
      <property name="CacheCallableStmts" value="false" />
      <property name="CachePrepStmts" value="false" />
      <property name="CachePreparedStatements" value="false" />
      <property name="CacheResultSetMetadata" value="false" />
      <property name="CacheServerConfiguration" value="false" />
      <property name="CallableStatementCacheSize" value="100" />
      <property name="CallableStmtCacheSize" value="100" />
      <property name="CapitalizeTypeNames" value="true" />
      <property name="ClientInfoProvider" value="com.mysql.jdbc.JDBC4CommentClientInfoProvider" />
      <property name="ClobberStreamingResults" value="false" />
      <property name="CompensateOnDuplicateKeyUpdateCounts" value="false" />
      <property name="ConnectTimeout" value="0" />
      <property name="ContinueBatchOnError" value="true" />
      <property name="CreateDatabaseIfNotExist" value="false" />
      <property name="DefaultFetchSize" value="0" />
      <property name="DontTrackOpenResources" value="false" />
      <property name="DumpMetadataOnColumnNotFound" value="false" />
      <property name="DumpQueriesOnException" value="false" />
      <property name="DynamicCalendars" value="false" />
      <property name="ElideSetAutoCommits" value="false" />
      <property name="EmptyStringsConvertToZero" value="true" />
      <property name="EmulateLocators" value="false" />
      <property name="EmulateUnsupportedPstmts" value="true" />
      <property name="EnablePacketDebug" value="false" />
      <property name="EnableQueryTimeouts" value="true" />
      <property name="ExplainSlowQueries" value="false" />
      <property name="FailOverReadOnly" value="true" />
      <property name="FunctionsNeverReturnBlobs" value="false" />
      <property name="GatherPerfMetrics" value="false" />
      <property name="GatherPerformanceMetrics" value="false" />
      <property name="GenerateSimpleParameterMetadata" value="false" />
      <property name="HoldResultsOpenOverStatementClose" value="false" />
      <property name="IgnoreNonTxTables" value="false" />
      <property name="IncludeInnodbStatusInDeadlockExceptions" value="false" />
      <property name="InitialTimeout" value="2" />
      <property name="InteractiveClient" value="false" />
      <property name="IsInteractiveClient" value="false" />
      <property name="JdbcCompliantTruncation" value="true" />
      <property name="JdbcCompliantTruncationForReads" value="true" />
      <property name="LoadBalanceBlacklistTimeout" value="0" />
      <property name="LoadBalanceStrategy" value="random" />
      <property name="LocatorFetchBufferSize" value="1048576" />
      <property name="LogSlowQueries" value="false" />
      <property name="LogXaCommands" value="false" />
      <property name="Logger" value="com.mysql.jdbc.log.StandardLogger" />
      <property name="LoggerClassName" value="com.mysql.jdbc.log.StandardLogger" />
      <property name="LoginTimeout" value="0" />
      <property name="MaintainTimeStats" value="true" />
      <property name="MaxAllowedPacket" value="-1" />
      <property name="MaxQuerySizeToLog" value="2048" />
      <property name="MaxReconnects" value="3" />
      <property name="MaxRows" value="-1" />
      <property name="MetadataCacheSize" value="50" />
      <property name="NetTimeoutForStreamingResults" value="600" />
      <property name="NoAccessToProcedureBodies" value="false" />
      <property name="NoDatetimeStringSync" value="false" />
      <property name="NoTimezoneConversionForTimeType" value="false" />
      <property name="NullCatalogMeansCurrent" value="true" />
      <property name="NullNamePatternMatchesAll" value="true" />
      <property name="OverrideSupportsIntegrityEnhancementFacility" value="false" />
      <property name="PacketDebugBufferSize" value="20" />
      <property name="PadCharsWithSpace" value="false" />
      <property name="Paranoid" value="false" />
      <property name="Password" value="xxx" />
      <property name="Pedantic" value="false" />
      <property name="PinGlobalTxToPhysicalConnection" value="false" />
      <property name="PopulateInsertRowWithDefaultValues" value="false" />
      <property name="Port" value="3306" />
      <property name="PortNumber" value="3306" />
      <property name="PrepStmtCacheSize" value="25" />
      <property name="PrepStmtCacheSqlLimit" value="256" />
      <property name="PreparedStatementCacheSize" value="25" />
      <property name="PreparedStatementCacheSqlLimit" value="256" />
      <property name="ProcessEscapeCodesForPrepStmts" value="true" />
      <property name="ProfileSQL" value="false" />
      <property name="ProfileSql" value="false" />
      <property name="ProfilerEventHandler" value="com.mysql.jdbc.profiler.LoggingProfilerEventHandler" />
      <property name="QueriesBeforeRetryMaster" value="50" />
      <property name="QueryTimeoutKillsConnection" value="false" />
      <property name="ReconnectAtTxEnd" value="false" />
      <property name="RelaxAutoCommit" value="false" />
      <property name="ReportMetricsIntervalMillis" value="30000" />
      <property name="RequireSSL" value="false" />
      <property name="ResultSetSizeThreshold" value="100" />
      <property name="RetriesAllDown" value="120" />
      <property name="RewriteBatchedStatements" value="false" />
      <property name="RollbackOnPooledClose" value="true" />
      <property name="RoundRobinLoadBalance" value="false" />
      <property name="RunningCTS13" value="false" />
      <property name="SecondsBeforeRetryMaster" value="30" />
      <property name="SelfDestructOnPingMaxOperations" value="0" />
      <property name="SelfDestructOnPingSecondsLifetime" value="0" />
      <property name="SlowQueryThresholdMillis" value="2000" />
      <property name="SlowQueryThresholdNanos" value="0" />
      <property name="SocketFactory" value="com.mysql.jdbc.StandardSocketFactory" />
      <property name="SocketFactoryClassName" value="com.mysql.jdbc.StandardSocketFactory" />
      <property name="SocketTimeout" value="0" />
      <property name="StrictFloatingPoint" value="false" />
      <property name="StrictUpdates" value="true" />
      <property name="TcpKeepAlive" value="true" />
      <property name="TcpNoDelay" value="true" />
      <property name="TcpRcvBuf" value="0" />
      <property name="TcpSndBuf" value="0" />
      <property name="TcpTrafficClass" value="0" />
      <property name="TinyInt1isBit" value="true" />
      <property name="TraceProtocol" value="false" />
      <property name="TransformedBitIsBoolean" value="false" />
      <property name="TreatUtilDateAsTimestamp" value="true" />
      <property name="URL" value="jdbc:mysql://localhost:3306/zetowr" />
      <property name="UltraDevHack" value="false" />
      <property name="Url" value="jdbc:mysql://localhost:3306/zetowr" />
      <property name="UseAffectedRows" value="false" />
      <property name="UseBlobToStoreUTF8OutsideBMP" value="false" />
      <property name="UseColumnNamesInFindColumn" value="false" />
      <property name="UseCompression" value="false" />
      <property name="UseCursorFetch" value="false" />
      <property name="UseDirectRowUnpack" value="true" />
      <property name="UseDynamicCharsetInfo" value="true" />
      <property name="UseFastDateParsing" value="true" />
      <property name="UseFastIntParsing" value="true" />
      <property name="UseGmtMillisForDatetimes" value="false" />
      <property name="UseHostsInPrivileges" value="true" />
      <property name="UseInformationSchema" value="false" />
      <property name="UseJDBCCompliantTimezoneShift" value="false" />
      <property name="UseJvmCharsetConverters" value="false" />
      <property name="UseLegacyDatetimeCode" value="true" />
      <property name="UseLocalSessionState" value="false" />
      <property name="UseLocalTransactionState" value="false" />
      <property name="UseNanosForElapsedTime" value="false" />
      <property name="UseOldAliasMetadataBehavior" value="false" />
      <property name="UseOldUTF8Behavior" value="false" />
      <property name="UseOnlyServerErrorMessages" value="true" />
      <property name="UseReadAheadInput" value="true" />
      <property name="UseSSL" value="false" />
      <property name="UseSSPSCompatibleTimezoneShift" value="false" />
      <property name="UseServerPrepStmts" value="false" />
      <property name="UseServerPreparedStmts" value="false" />
      <property name="UseSqlStateCodes" value="true" />
      <property name="UseStreamLengthsInPrepStmts" value="true" />
      <property name="UseTimezone" value="false" />
      <property name="UseUltraDevWorkAround" value="false" />
      <property name="UseUnbufferedInput" value="true" />
      <property name="UseUnicode" value="true" />
      <property name="UseUsageAdvisor" value="false" />
      <property name="User" value="root" />
      <property name="VerifyServerCertificate" value="true" />
      <property name="YearIsDateType" value="true" />
      <property name="ZeroDateTimeBehavior" value="exception" />
    </jdbc-connection-pool>
    <jdbc-resource pool-name="zetowr_at_energia" jndi-name="jdbc/zetowr_at_energia" />


And the working persistence unit:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="ZbiorPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>jdbc/zetowr_at_energia</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="eclipselink.ddl-generation" value="create-tables"/>
    </properties>
  </persistence-unit>
</persistence>

And finally the code that dont work (JSP):

<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<sql:query var="agregujMail" dataSource="jdbc/zetowr_at_energia">
    SELECT ID_grupy, count(*) FROM zetowr_kontrola group by ID_grupy
</sql:query>
(...)
[Message sent by forum member 'madierfakier']

http://forums.java.net/jive/thread.jspa?messageID=470845